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 class
SpatialRTree.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.Builder
builder()
protected List<Shape>
collectGrids(List<Shape> list, RTree<V> tree)
gather the RTree nodes into a list for display as PaintablesV
getClosestElement(double x, double y)
get the node that is closest to the passed (x,y)V
getClosestElement(Point2D p)
Set<V>
getVisibleElements(Shape shape)
void
layoutVertexPositionChanged(LayoutVertexPositionChange.Event<V> evt)
void
layoutVertexPositionChanged(LayoutVertexPositionChange.GraphEvent<V> evt)
void
recalculate()
rebuild the data structure // * // * @param elements the elements to insert into the data structurevoid
update(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:
getVisibleElements
in 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:
getClosestElement
in 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:
getClosestElement
in 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:SpatialRTree
gather the RTree nodes into a list for display as Paintables- Specified by:
collectGrids
in classSpatialRTree<V,V>
- Returns:
-
recalculate
public void recalculate()
rebuild the data structure // * // * @param elements the elements to insert into the data structure- Specified by:
recalculate
in interfaceSpatial<V,V>
-
layoutVertexPositionChanged
public void layoutVertexPositionChanged(LayoutVertexPositionChange.GraphEvent<V> evt)
- Specified by:
layoutVertexPositionChanged
in interfaceLayoutVertexPositionChange.Listener<V>
-
layoutVertexPositionChanged
public void layoutVertexPositionChanged(LayoutVertexPositionChange.Event<V> evt)
- Specified by:
layoutVertexPositionChanged
in interfaceLayoutVertexPositionChange.Listener<V>
-
-