Class LayoutDecorator<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.algorithms.layout.LayoutDecorator<V,E>
-
- All Implemented Interfaces:
com.google.common.base.Function<V,java.awt.geom.Point2D>,Layout<V,E>,IterativeContext,java.util.function.Function<V,java.awt.geom.Point2D>
- Direct Known Subclasses:
CachingLayout,ObservableCachingLayout
public abstract class LayoutDecorator<V,E> extends java.lang.Object implements Layout<V,E>, IterativeContext
a pure decorator for the Layout interface. Intended to be overridden to provide specific behavior decoration
-
-
Constructor Summary
Constructors Constructor Description LayoutDecorator(Layout<V,E> delegate)Creates an instance backed by the specifieddelegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandone()Layout<V,E>getDelegate()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()voidsetDelegate(Layout<V,E> delegate)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)voidstep()Advances one step.java.awt.geom.Point2Dtransform(V v)
-
-
-
Method Detail
-
step
public void step()
Description copied from interface:IterativeContextAdvances one step.- Specified by:
stepin interfaceIterativeContext
-
initialize
public void initialize()
Description copied from interface:LayoutInitializes fields in the node that may not have been set during the constructor. Must be called before the iterations begin.- Specified by:
initializein interfaceLayout<V,E>
-
setInitializer
public void setInitializer(com.google.common.base.Function<V,java.awt.geom.Point2D> initializer)
- Specified by:
setInitializerin interfaceLayout<V,E>- Parameters:
initializer- a function that specifies initial locations for all vertices
-
setLocation
public void setLocation(V v, java.awt.geom.Point2D location)
Description copied from interface:LayoutChanges the layout coordinates ofvtolocation.- Specified by:
setLocationin interfaceLayout<V,E>- Parameters:
v- the vertex whose location is to be specifiedlocation- the coordinates of the specified location
-
getSize
public java.awt.Dimension getSize()
-
transform
public java.awt.geom.Point2D transform(V v)
-
done
public boolean done()
- Specified by:
donein interfaceIterativeContext- Returns:
trueif this iterative process is finished, andfalseotherwise.
-
lock
public void lock(V v, boolean state)
Description copied from interface:LayoutLocks 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.
-
isLocked
public boolean isLocked(V v)
-
setSize
public void setSize(java.awt.Dimension d)
-
-