Class AbstractSpatial<T,NT>
- java.lang.Object
-
- org.jungrapht.visualization.spatial.AbstractSpatial<T,NT>
-
- Type Parameters:
T- the element type that is managed by the spatial data structure. Node or EdgeNT- the node type for the LayoutModel reference. Could be the same as T.
- All Implemented Interfaces:
LayoutStateChange.Listener,LayoutVertexPositionChange.Listener<NT>,Spatial<T,NT>
- Direct Known Subclasses:
Spatial.NoOp,SpatialGrid,SpatialQuadTree,SpatialRTree
public abstract class AbstractSpatial<T,NT> extends Object implements Spatial<T,NT>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jungrapht.visualization.spatial.Spatial
Spatial.NoOp<T,NT>
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Shape>gridCachea memoization of the grid rectangles used for rendering as Paintables for debuggingprotected LayoutModel<NT>layoutModelthe layoutModel that the structure operates onprotected Collection<Shape>pickShapesprotected Rectangle2Drectangle
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSpatial(LayoutModel<NT> layoutModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NTgetClosest(Collection<NT> nodes, double x, double y, double radius)LayoutModel<NT>getLayoutModel()Collection<Shape>getPickShapes()a short-lived collection of recent pick target areasbooleanisActive()voidlayoutStateChanged(LayoutStateChange.Event evt)voidsetActive(boolean active)a flag to suggest whether or not the spatial structure should be used-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jungrapht.visualization.layout.event.LayoutVertexPositionChange.Listener
layoutVertexPositionChanged, layoutVertexPositionChanged
-
Methods inherited from interface org.jungrapht.visualization.spatial.Spatial
clear, getClosestElement, getClosestElement, getContainingLeaf, getContainingLeafs, getContainingLeafs, getGrid, getLayoutArea, getUnion, getUnion, getVisibleElements, recalculate, setBounds, update
-
-
-
-
Field Detail
-
rectangle
protected Rectangle2D rectangle
-
pickShapes
protected Collection<Shape> pickShapes
-
gridCache
protected List<Shape> gridCache
a memoization of the grid rectangles used for rendering as Paintables for debugging
-
layoutModel
protected LayoutModel<NT> layoutModel
the layoutModel that the structure operates on
-
-
Constructor Detail
-
AbstractSpatial
protected AbstractSpatial(LayoutModel<NT> layoutModel)
-
-
Method Detail
-
getPickShapes
public Collection<Shape> getPickShapes()
Description copied from interface:Spatiala short-lived collection of recent pick target areas- Specified by:
getPickShapesin interfaceSpatial<T,NT>- Returns:
-
isActive
public boolean isActive()
-
setActive
public void setActive(boolean active)
Description copied from interface:Spatiala flag to suggest whether or not the spatial structure should be used
-
getLayoutModel
public LayoutModel<NT> getLayoutModel()
- Specified by:
getLayoutModelin interfaceSpatial<T,NT>
-
getClosest
protected NT getClosest(Collection<NT> nodes, double x, double y, double radius)
-
layoutStateChanged
public void layoutStateChanged(LayoutStateChange.Event evt)
- Specified by:
layoutStateChangedin interfaceLayoutStateChange.Listener
-
-