Interface Layout<V,E>
-
- All Superinterfaces:
com.google.common.base.Function<V,java.awt.geom.Point2D>,java.util.function.Function<V,java.awt.geom.Point2D>
- All Known Subinterfaces:
PersistentLayout<V,E>
- All Known Implementing Classes:
AbstractLayout,AggregateLayout,BalloonLayout,CachingLayout,CircleLayout,DAGLayout,FastRenderingLayout,FRLayout,FRLayout2,ISOMLayout,KKLayout,LayoutDecorator,ObservableCachingLayout,PersistentLayoutImpl,RadialTreeLayout,SpringLayout,SpringLayout2,StaticLayout,TreeLayout
public interface Layout<V,E> extends com.google.common.base.Function<V,java.awt.geom.Point2D>A generalized interface is a mechanism for returning (x,y) coordinates from vertices. In general, most of these methods are used to both control and get information from the layout algorithm.- Author:
- danyelf, tom nelson
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Graph<V,E>getGraph()java.awt.DimensiongetSize()voidinitialize()Initializes fields in the node that may not have been set during the constructor.booleanisLocked(V v)voidlock(V v, boolean state)Locks or unlocks the specified vertex.voidreset()voidsetGraph(Graph<V,E> graph)voidsetInitializer(com.google.common.base.Function<V,java.awt.geom.Point2D> initializer)voidsetLocation(V v, java.awt.geom.Point2D location)Changes the layout coordinates ofvtolocation.voidsetSize(java.awt.Dimension d)
-
-
-
Method Detail
-
initialize
void initialize()
Initializes fields in the node that may not have been set during the constructor. Must be called before the iterations begin.
-
setInitializer
void setInitializer(com.google.common.base.Function<V,java.awt.geom.Point2D> initializer)
- Parameters:
initializer- a function that specifies initial locations for all vertices
-
setGraph
void setGraph(Graph<V,E> graph)
- Parameters:
graph- the graph that this algorithm is to operate on
-
reset
void reset()
-
setSize
void setSize(java.awt.Dimension d)
- Parameters:
d- the space to use to lay out this graph
-
getSize
java.awt.Dimension getSize()
- Returns:
- the current size of the visualization's space
-
lock
void lock(V v, boolean state)
Locks or unlocks the specified vertex. Locking the vertex fixes it at its current position, so that it will not be affected by the layout algorithm. Unlocking it allows the layout algorithm to change the vertex's position.- Parameters:
v- the vertex to lock/unlockstate-trueto lock the vertex,falseto unlock it
-
isLocked
boolean isLocked(V v)
- Parameters:
v- the vertex whose locked state is being queried- Returns:
trueif the position of vertexvis locked
-
setLocation
void setLocation(V v, java.awt.geom.Point2D location)
Changes the layout coordinates ofvtolocation.- Parameters:
v- the vertex whose location is to be specifiedlocation- the coordinates of the specified location
-
-