V
- the vertex typeE
- the edge typepublic class AggregateLayout<V,E> extends 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 Map<Layout<V,E>,Point2D> |
layouts |
Constructor and Description |
---|
AggregateLayout(Layout<V,E> delegate)
Creates an instance backed by the specified
delegate . |
Modifier and Type | Method and Description |
---|---|
Point2D |
apply(V v)
Returns the location of the vertex.
|
boolean |
done() |
Point2D |
get(Layout<V,E> layout) |
Layout<V,E> |
getDelegate() |
Graph<V,E> |
getGraph() |
Map<Layout<V,E>,Point2D> |
getLayouts() |
Dimension |
getSize() |
void |
initialize()
Initializes fields in the node that may not have
been set during the constructor.
|
boolean |
isLocked(V v) |
void |
lock(V v,
boolean state)
Locks this vertex in the main layout and in any sublayouts whose graph contains
this vertex.
|
void |
put(Layout<V,E> layout,
Point2D center)
Adds the passed layout as a sublayout, and specifies
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) |
void |
setInitializer(com.google.common.base.Function<V,Point2D> initializer) |
void |
setLocation(V v,
Point2D location)
Changes the layout coordinates of
v to location . |
void |
setSize(Dimension d) |
void |
step()
Call step on any sublayout that is also an IterativeContext and is not done
|
public void setDelegate(Layout<V,E> delegate)
delegate
- the delegate to setpublic void put(Layout<V,E> layout, Point2D center)
layout
- the layout algorithm to use as a sublayoutcenter
- the center of the coordinates for the sublayoutpublic Point2D get(Layout<V,E> layout)
layout
- the layout whose center is to be returnedpublic void remove(Layout<V,E> layout)
layout
from this instance.layout
- the layout to removepublic void removeAll()
public Dimension getSize()
public void initialize()
Layout
initialize
in interface Layout<V,E>
public boolean isLocked(V v)
public void lock(V v, boolean state)
public void setInitializer(com.google.common.base.Function<V,Point2D> initializer)
setInitializer
in interface Layout<V,E>
initializer
- a function that specifies initial locations for all verticespublic void setLocation(V v, Point2D location)
Layout
v
to location
.setLocation
in interface Layout<V,E>
v
- the vertex whose location is to be specifiedlocation
- the coordinates of the specified locationpublic void setSize(Dimension d)
public Map<Layout<V,E>,Point2D> getLayouts()
Layout
instance to its center point.public Point2D apply(V v)
public boolean done()
done
in interface IterativeContext
true
iff the delegate layout and all sublayouts are donepublic void step()
step
in interface IterativeContext
Copyright © 2015. All rights reserved.