Class SpatialRTree.Vertices<V>
- java.lang.Object
-
- org.jungrapht.visualization.spatial.AbstractSpatial<T,NT>
-
- org.jungrapht.visualization.spatial.SpatialRTree<V,V>
-
- org.jungrapht.visualization.spatial.SpatialRTree.Vertices<V>
-
- All Implemented Interfaces:
LayoutStateChange.Listener,LayoutVertexPositionChange.Listener<V>,Spatial<V,V>
- Enclosing class:
- SpatialRTree<T,NT>
public static class SpatialRTree.Vertices<V> extends SpatialRTree<V,V> implements Spatial<V,V>, LayoutVertexPositionChange.Listener<V>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpatialRTree.Vertices.Builder<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.Vertices.Builderbuilder()protected List<Shape>collectGrids(List<Shape> list, RTree<V> tree)gather the RTree nodes into a list for display as PaintablesVgetClosestElement(double x, double y)get the node that is closest to the passed (x,y)VgetClosestElement(Point2D p)Set<V>getVisibleElements(Shape shape)voidlayoutVertexPositionChanged(LayoutVertexPositionChange.Event<V> evt)voidlayoutVertexPositionChanged(LayoutVertexPositionChange.GraphEvent<V> evt)voidrecalculate()rebuild the data structure // * // * @param elements the elements to insert into the data structurevoidupdate(V 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.Vertices.Builder builder()
-
getVisibleElements
public Set<V> getVisibleElements(Shape shape)
- Specified by:
getVisibleElementsin interfaceSpatial<V,V>- Parameters:
shape- the possibly non-rectangular area of interest- Returns:
- all nodes that are contained within the passed Shape
-
getClosestElement
public V getClosestElement(Point2D p)
- Specified by:
getClosestElementin interfaceSpatial<V,V>- Parameters:
p- a point to search in the spatial structure- Returns:
- the closest element to the passed point
-
getClosestElement
public V getClosestElement(double x, double y)
get the node that is closest to the passed (x,y)- Specified by:
getClosestElementin interfaceSpatial<V,V>- Parameters:
x-y-- Returns:
- the node closest to x,y
-
collectGrids
protected List<Shape> collectGrids(List<Shape> list, RTree<V> tree)
Description copied from class:SpatialRTreegather the RTree nodes into a list for display as Paintables- Specified by:
collectGridsin classSpatialRTree<V,V>- Returns:
-
recalculate
public void recalculate()
rebuild the data structure // * // * @param elements the elements to insert into the data structure- Specified by:
recalculatein interfaceSpatial<V,V>
-
layoutVertexPositionChanged
public void layoutVertexPositionChanged(LayoutVertexPositionChange.GraphEvent<V> evt)
- Specified by:
layoutVertexPositionChangedin interfaceLayoutVertexPositionChange.Listener<V>
-
layoutVertexPositionChanged
public void layoutVertexPositionChanged(LayoutVertexPositionChange.Event<V> evt)
- Specified by:
layoutVertexPositionChangedin interfaceLayoutVertexPositionChange.Listener<V>
-
-