V
- the vertex typeE
- the edge typepublic class AggregateLayout<V,E> extends java.lang.Object implements Layout<V,E>, IterativeContext
Layout
implementation that combines
multiple other layouts so that they may be manipulated
as one layout. The relaxer thread will step each layout
in sequence.Modifier and Type | Field and Description |
---|---|
protected Layout<V,E> |
delegate |
protected java.util.Map<Layout<V,E>,java.awt.geom.Point2D> |
layouts |
Constructor and Description |
---|
AggregateLayout(Layout<V,E> delegate)
Creates an instance backed by the specified
delegate . |
Modifier and Type | Method and Description |
---|---|
boolean |
done()
Check all sublayouts.keySet() and the delegate layout, returning
done == true iff all are done.
|
java.awt.geom.Point2D |
get(Layout<V,E> layout)
Returns the center of the passed layout.
|
Layout<V,E> |
getDelegate() |
edu.uci.ics.jung.graph.Graph<V,E> |
getGraph()
Returns the graph for which this layout is defined.
|
java.util.Map<Layout<V,E>,java.awt.geom.Point2D> |
getLayouts()
Returns a map from each
Layout instance to its center point. |
java.awt.Dimension |
getSize()
Returns the size of the underlying layout.
|
void |
initialize()
Initializes fields in the node that may not have
been set during the constructor.
|
boolean |
isLocked(V v)
Override to test if the passed vertex is locked in
any of the layouts.
|
void |
lock(V v,
boolean state)
override to lock or unlock this vertex in any layout with
a subgraph containing it
|
void |
put(Layout<V,E> layout,
java.awt.geom.Point2D center)
adds the passed layout as a sublayout, also specifying
the center of where this sublayout should appear
|
void |
remove(Layout<V,E> layout)
Removes
layout from this instance. |
void |
removeAll()
Removes all layouts from this instance.
|
void |
reset() |
void |
setDelegate(Layout<V,E> delegate) |
void |
setGraph(edu.uci.ics.jung.graph.Graph<V,E> graph)
setter for graph
|
void |
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 vertex
|
void |
setSize(java.awt.Dimension d) |
void |
step()
call step on any sublayout that is also an IterativeContext
and is not done
|
java.awt.geom.Point2D |
transform(V v)
Returns the location of the vertex.
|
public void put(Layout<V,E> layout, java.awt.geom.Point2D center)
layout
- center
- public java.awt.geom.Point2D get(Layout<V,E> layout)
layout
- public void removeAll()
public edu.uci.ics.jung.graph.Graph<V,E> getGraph()
getGraph
in interface Layout<V,E>
Layout.getGraph()
public java.awt.Dimension getSize()
getSize
in interface Layout<V,E>
Layout.getSize()
public void initialize()
Layout
initialize
in interface Layout<V,E>
Layout.initialize()
public boolean isLocked(V v)
isLocked
in interface Layout<V,E>
v
- Layout.isLocked(java.lang.Object)
public void lock(V v, boolean state)
lock
in interface Layout<V,E>
v
- state
- Layout.lock(java.lang.Object, boolean)
public void reset()
reset
in interface Layout<V,E>
Layout.reset()
public void setGraph(edu.uci.ics.jung.graph.Graph<V,E> graph)
Layout
setGraph
in interface Layout<V,E>
graph
- Layout.setGraph(edu.uci.ics.jung.graph.Graph)
public void setInitializer(org.apache.commons.collections4.Transformer<V,java.awt.geom.Point2D> initializer)
Layout
setInitializer
in interface Layout<V,E>
initializer
- Layout.setInitializer(org.apache.commons.collections4.Transformer)
public void setLocation(V v, java.awt.geom.Point2D location)
Layout
setLocation
in interface Layout<V,E>
v
- location
- Layout.setLocation(java.lang.Object, java.awt.geom.Point2D)
public void setSize(java.awt.Dimension d)
setSize
in interface Layout<V,E>
d
- Layout.setSize(java.awt.Dimension)
public java.util.Map<Layout<V,E>,java.awt.geom.Point2D> getLayouts()
Layout
instance to its center point.public java.awt.geom.Point2D transform(V v)
transform
in interface org.apache.commons.collections4.Transformer<V,java.awt.geom.Point2D>
Transformer.transform(java.lang.Object)
public boolean done()
done
in interface IterativeContext
public void step()
step
in interface IterativeContext