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() |
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(Graph<V,E> graph)
setter for graph
|
void |
setInitializer(org.apache.commons.collections15.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 setDelegate(Layout<V,E> delegate)
delegate - the delegate to setpublic 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 java.awt.Dimension getSize()
public void initialize()
Layoutinitialize in interface Layout<V,E>public boolean isLocked(V v)
public void lock(V v, boolean state)
public void setGraph(Graph<V,E> graph)
Layoutpublic void setInitializer(org.apache.commons.collections15.Transformer<V,java.awt.geom.Point2D> initializer)
LayoutsetInitializer in interface Layout<V,E>initializer - public void setLocation(V v, java.awt.geom.Point2D location)
LayoutsetLocation in interface Layout<V,E>v - location - public void setSize(java.awt.Dimension d)
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.collections15.Transformer<V,java.awt.geom.Point2D>Transformer.transform(java.lang.Object)public boolean done()
done in interface IterativeContextpublic void step()
step in interface IterativeContextCopyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence