edu.uci.ics.jung.algorithms.layout
Class LayoutDecorator<V,E>

java.lang.Object
  extended by edu.uci.ics.jung.algorithms.layout.LayoutDecorator<V,E>
All Implemented Interfaces:
Layout<V,E>, IterativeContext, org.apache.commons.collections15.Transformer<V,Point2D>
Direct Known Subclasses:
CachingLayout, ObservableCachingLayout

public abstract class LayoutDecorator<V,E>
extends Object
implements Layout<V,E>, IterativeContext

a pure decorator for the Layout interface. Intended to be overridden to provide specific behavior decoration

Author:
Tom Nelson

Field Summary
protected  Layout<V,E> delegate
           
 
Constructor Summary
LayoutDecorator(Layout<V,E> delegate)
          Creates an instance backed by the specified delegate layout.
 
Method Summary
 boolean done()
          Returns true if this iterative process is finished, and false otherwise.
 Layout<V,E> getDelegate()
          Returns the backing (delegate) layout.
 Graph<V,E> getGraph()
          Returns the full graph (the one that was passed in at construction time) that this Layout refers to.
 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)
          Returns true if the position of vertex v 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(Graph<V,E> graph)
          setter for graph
 void setInitializer(org.apache.commons.collections15.Transformer<V,Point2D> initializer)
          provides initial locations for all vertices.
 void setLocation(V v, Point2D location)
          set the location of a vertex
 void setSize(Dimension d)
           
 void step()
          Advances one step.
 Point2D transform(V v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected Layout<V,E> delegate
Constructor Detail

LayoutDecorator

public LayoutDecorator(Layout<V,E> delegate)
Creates an instance backed by the specified delegate layout.

Method Detail

getDelegate

public Layout<V,E> getDelegate()
Returns the backing (delegate) layout.


setDelegate

public void setDelegate(Layout<V,E> delegate)
Sets the backing (delegate) layout.


step

public void step()
Description copied from interface: IterativeContext
Advances one step.

Specified by:
step in interface IterativeContext
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 interface Layout<V,E>
See Also:
Layout.initialize()

setInitializer

public void setInitializer(org.apache.commons.collections15.Transformer<V,Point2D> initializer)
Description copied from interface: Layout
provides initial locations for all vertices.

Specified by:
setInitializer in interface Layout<V,E>
Parameters:
initializer -
See Also:
Layout.setInitializer(org.apache.commons.collections15.Transformer)

setLocation

public void setLocation(V v,
                        Point2D location)
Description copied from interface: Layout
set the location of a vertex

Specified by:
setLocation in interface Layout<V,E>
Parameters:
v -
location -
See Also:
Layout.setLocation(java.lang.Object, java.awt.geom.Point2D)

getSize

public Dimension getSize()
Description copied from interface: Layout
Returns the current size of the visualization's space.

Specified by:
getSize in interface Layout<V,E>
See Also:
Layout.getSize()

getGraph

public 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 interface Layout<V,E>
See Also:
Layout.getGraph()

transform

public Point2D transform(V v)
Specified by:
transform in interface org.apache.commons.collections15.Transformer<V,Point2D>
See Also:
Transformer.transform(Object)

done

public boolean done()
Description copied from interface: IterativeContext
Returns true if this iterative process is finished, and false otherwise.

Specified by:
done in interface IterativeContext
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 interface Layout<V,E>
Parameters:
v - vertex
See Also:
Layout.lock(Object, boolean)

isLocked

public boolean isLocked(V v)
Description copied from interface: Layout
Returns true if the position of vertex v is locked.

Specified by:
isLocked in interface Layout<V,E>
See Also:
Layout.isLocked(Object)

setSize

public void setSize(Dimension d)
Specified by:
setSize in interface Layout<V,E>
See Also:
Layout.setSize(Dimension)

reset

public void reset()
Specified by:
reset in interface Layout<V,E>
See Also:
Layout.reset()

setGraph

public void setGraph(Graph<V,E> graph)
Description copied from interface: Layout
setter for graph

Specified by:
setGraph in interface Layout<V,E>


Copyright © 2009. All Rights Reserved.