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 boolean
done()
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.Dimension
getSize()
Returns the current size of the visualization's space.void
initialize()
Initializes fields in the node that may not have been set during the constructor.boolean
isLocked(V v)
Returnstrue
if the position of vertexv
is locked.void
lock(V v, boolean state)
Sets a flag which fixes this vertex in place.void
reset()
void
setDelegate(Layout<V,E> delegate)
Sets the backing (delegate) layout.void
setGraph(edu.uci.ics.jung.graph.Graph<V,E> graph)
setter for graphvoid
setInitializer(org.apache.commons.collections4.Transformer<V,java.awt.geom.Point2D> initializer)
provides initial locations for all vertices.void
setLocation(V v, java.awt.geom.Point2D location)
set the location of a vertexvoid
setSize(java.awt.Dimension d)
void
step()
Advances one step.java.awt.geom.Point2D
transform(V v)
-
-
-
Method Detail
-
step
public void step()
Description copied from interface:IterativeContext
Advances one step.- Specified by:
step
in interfaceIterativeContext
- See Also:
IterativeContext.done()
-
initialize
public void initialize()
Description copied from interface:Layout
Initializes fields in the node that may not have been set during the constructor. Must be called before the iterations begin.- Specified by:
initialize
in 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:Layout
provides initial locations for all vertices.- Specified by:
setInitializer
in 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:Layout
set the location of a vertex- Specified by:
setLocation
in 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:Layout
Returns the current size of the visualization's space.- Specified by:
getSize
in interfaceLayout<V,E>
- See Also:
Layout.getSize()
-
getGraph
public edu.uci.ics.jung.graph.Graph<V,E> getGraph()
Description copied from interface:Layout
Returns the full graph (the one that was passed in at construction time) that this Layout refers to.- Specified by:
getGraph
in interfaceLayout<V,E>
- See Also:
Layout.getGraph()
-
transform
public java.awt.geom.Point2D transform(V v)
-
done
public boolean done()
Description copied from interface:IterativeContext
Returns true if this iterative process is finished, and false otherwise.- Specified by:
done
in interfaceIterativeContext
- See Also:
IterativeContext.done()
-
lock
public void lock(V v, boolean state)
Description copied from interface:Layout
Sets a flag which fixes this vertex in place.- Specified by:
lock
in interfaceLayout<V,E>
- Parameters:
v
- vertex- See Also:
Layout.lock(Object, boolean)
-
isLocked
public boolean isLocked(V v)
Description copied from interface:Layout
Returnstrue
if the position of vertexv
is locked.- Specified by:
isLocked
in interfaceLayout<V,E>
- See Also:
Layout.isLocked(Object)
-
setSize
public void setSize(java.awt.Dimension d)
- Specified by:
setSize
in interfaceLayout<V,E>
- See Also:
Layout.setSize(Dimension)
-
reset
public void reset()
- Specified by:
reset
in interfaceLayout<V,E>
- See Also:
Layout.reset()
-
-