Class LayoutDecorator<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.algorithms.layout.LayoutDecorator<V,E>
-
- All Implemented Interfaces:
Layout<V,E>,IterativeContext,org.apache.commons.collections4.Transformer<V,java.awt.geom.Point2D>
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 specified delegate layout.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandone()Returns true if this iterative process is finished, and false otherwise.Layout<V,E>getDelegate()Returns the backing (delegate) layout.edu.uci.ics.jung.graph.Graph<V,E>getGraph()Returns the full graph (the one that was passed in at construction time) that this Layout refers to.java.awt.DimensiongetSize()Returns the current size of the visualization's space.voidinitialize()Initializes fields in the node that may not have been set during the constructor.booleanisLocked(V v)Returnstrueif the position of vertexvis locked.voidlock(V v, boolean state)Sets a flag which fixes this vertex in place.voidreset()voidsetDelegate(Layout<V,E> delegate)Sets the backing (delegate) layout.voidsetGraph(edu.uci.ics.jung.graph.Graph<V,E> graph)setter for graphvoidsetInitializer(org.apache.commons.collections4.Transformer<V,java.awt.geom.Point2D> initializer)provides initial locations for all vertices.voidsetLocation(V v, java.awt.geom.Point2D location)set the location of a vertexvoidsetSize(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- See Also:
IterativeContext.done()
-
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>- See Also:
Layout.initialize()
-
setInitializer
public void setInitializer(org.apache.commons.collections4.Transformer<V,java.awt.geom.Point2D> initializer)
Description copied from interface:Layoutprovides initial locations for all vertices.- Specified by:
setInitializerin interfaceLayout<V,E>- Parameters:
initializer-- See Also:
Layout.setInitializer(org.apache.commons.collections4.Transformer)
-
setLocation
public void setLocation(V v, java.awt.geom.Point2D location)
Description copied from interface:Layoutset the location of a vertex- Specified by:
setLocationin interfaceLayout<V,E>- Parameters:
v-location-- See Also:
Layout.setLocation(java.lang.Object, java.awt.geom.Point2D)
-
getSize
public java.awt.Dimension getSize()
Description copied from interface:LayoutReturns the current size of the visualization's space.- Specified by:
getSizein interfaceLayout<V,E>- See Also:
Layout.getSize()
-
getGraph
public edu.uci.ics.jung.graph.Graph<V,E> getGraph()
Description copied from interface:LayoutReturns the full graph (the one that was passed in at construction time) that this Layout refers to.- Specified by:
getGraphin interfaceLayout<V,E>- See Also:
Layout.getGraph()
-
transform
public java.awt.geom.Point2D transform(V v)
-
done
public boolean done()
Description copied from interface:IterativeContextReturns true if this iterative process is finished, and false otherwise.- Specified by:
donein interfaceIterativeContext- See Also:
IterativeContext.done()
-
lock
public void lock(V v, boolean state)
Description copied from interface:LayoutSets a flag which fixes this vertex in place.- Specified by:
lockin interfaceLayout<V,E>- Parameters:
v- vertex- See Also:
Layout.lock(Object, boolean)
-
isLocked
public boolean isLocked(V v)
Description copied from interface:LayoutReturnstrueif the position of vertexvis locked.- Specified by:
isLockedin interfaceLayout<V,E>- See Also:
Layout.isLocked(Object)
-
setSize
public void setSize(java.awt.Dimension d)
- Specified by:
setSizein interfaceLayout<V,E>- See Also:
Layout.setSize(Dimension)
-
reset
public void reset()
- Specified by:
resetin interfaceLayout<V,E>- See Also:
Layout.reset()
-
-