Class SpatialRTree.Edges<E,V>
- java.lang.Object
-
- org.jungrapht.visualization.spatial.AbstractSpatial<T,NT>
-
- org.jungrapht.visualization.spatial.SpatialRTree<E,V>
-
- org.jungrapht.visualization.spatial.SpatialRTree.Edges<E,V>
-
- All Implemented Interfaces:
LayoutStateChange.Listener,LayoutVertexPositionChange.Listener<V>,Spatial<E,V>
- Enclosing class:
- SpatialRTree<T,NT>
public static class SpatialRTree.Edges<E,V> extends SpatialRTree<E,V> implements Spatial<E,V>, LayoutVertexPositionChange.Listener<V>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpatialRTree.Edges.Builder<E,V>-
Nested classes/interfaces inherited from class org.jungrapht.visualization.spatial.SpatialRTree
SpatialRTree.Edges<E,V>, SpatialRTree.Vertices<V>
-
Nested classes/interfaces inherited from interface org.jungrapht.visualization.spatial.Spatial
Spatial.NoOp<T,NT>
-
-
Field Summary
-
Fields inherited from class org.jungrapht.visualization.spatial.SpatialRTree
boundingRectangleCollector, reinsert, rtree, splitterContext
-
Fields inherited from class org.jungrapht.visualization.spatial.AbstractSpatial
gridCache, layoutModel, pickShapes, rectangle
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SpatialRTree.Edges.Builderbuilder()protected List<Shape>collectGrids(List<Shape> list, RTree<E> tree)gather the RTree nodes into a list for display as Paintablesprotected EgetClosestEdge(Collection<E> edges, double x, double y, double radius)EgetClosestElement(double x, double y)get the element that is closest to the passed (x,y)EgetClosestElement(Point2D p)get the element that is closest to the passed pointSet<E>getVisibleElements(Shape shape)voidlayoutVertexPositionChanged(LayoutVertexPositionChange.Event<V> evt)voidlayoutVertexPositionChanged(LayoutVertexPositionChange.GraphEvent<V> evt)voidrecalculate()rebuild the data structurevoidupdate(E element, Point location)update the position of the passed node-
Methods inherited from class org.jungrapht.visualization.spatial.SpatialRTree
bulkInsert, clear, getContainingLeaf, getContainingLeafs, getContainingLeafs, getGrid, getLayoutArea, isReinsert, recalculate, setBounds, setReinsert, toString
-
Methods inherited from class org.jungrapht.visualization.spatial.AbstractSpatial
getClosest, getLayoutModel, getPickShapes, isActive, layoutStateChanged, setActive
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jungrapht.visualization.layout.event.LayoutStateChange.Listener
layoutStateChanged
-
Methods inherited from interface org.jungrapht.visualization.spatial.Spatial
clear, getContainingLeaf, getContainingLeafs, getContainingLeafs, getGrid, getLayoutArea, getLayoutModel, getPickShapes, getUnion, getUnion, isActive, setActive, setBounds
-
-
-
-
Method Detail
-
builder
public static SpatialRTree.Edges.Builder builder()
-
getVisibleElements
public Set<E> getVisibleElements(Shape shape)
- Specified by:
getVisibleElementsin interfaceSpatial<E,V>- Parameters:
shape- the possibly non-rectangular area of interest- Returns:
- all nodes that are contained within the passed Shape
-
layoutVertexPositionChanged
public void layoutVertexPositionChanged(LayoutVertexPositionChange.Event<V> evt)
- Specified by:
layoutVertexPositionChangedin interfaceLayoutVertexPositionChange.Listener<E>
-
layoutVertexPositionChanged
public void layoutVertexPositionChanged(LayoutVertexPositionChange.GraphEvent<V> evt)
- Specified by:
layoutVertexPositionChangedin interfaceLayoutVertexPositionChange.Listener<E>
-
getClosestElement
public E getClosestElement(Point2D p)
get the element that is closest to the passed point- Specified by:
getClosestElementin interfaceSpatial<E,V>- Parameters:
p- a point to search in the spatial structure- Returns:
- the closest element
-
getClosestElement
public E getClosestElement(double x, double y)
get the element that is closest to the passed (x,y)- Specified by:
getClosestElementin interfaceSpatial<E,V>- Parameters:
x- coordinate to search fory- coordinate to search for- Returns:
- the element closest to x,y
-
getClosestEdge
protected E getClosestEdge(Collection<E> edges, double x, double y, double radius)
-
collectGrids
protected List<Shape> collectGrids(List<Shape> list, RTree<E> tree)
Description copied from class:SpatialRTreegather the RTree nodes into a list for display as Paintables- Specified by:
collectGridsin classSpatialRTree<E,V>- Returns:
-
recalculate
public void recalculate()
rebuild the data structure- Specified by:
recalculatein interfaceSpatial<E,V>
-
-