Class AggregateLayout<V,E>
java.lang.Object
edu.uci.ics.jung.algorithms.layout.AggregateLayout<V,E>
- Type Parameters:
V
- the vertex typeE
- the edge type
- All Implemented Interfaces:
com.google.common.base.Function<V,
,Point2D> Layout<V,
,E> IterativeContext
,Function<V,
Point2D>
A
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.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAggregateLayout
(Layout<V, E> delegate) Creates an instance backed by the specifieddelegate
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the location of the vertex.boolean
done()
getGraph()
getSize()
void
Initializes fields in the node that may not have been set during the constructor.boolean
void
Locks this vertex in the main layout and in any sublayouts whose graph contains this vertex.void
Adds the passed layout as a sublayout, and specifies the center of where this sublayout should appear.void
Removeslayout
from this instance.void
Removes all layouts from this instance.void
reset()
void
setDelegate
(Layout<V, E> delegate) void
void
setInitializer
(com.google.common.base.Function<V, Point2D> initializer) void
setLocation
(V v, Point2D location) Changes the layout coordinates ofv
tolocation
.void
void
step()
Call step on any sublayout that is also an IterativeContext and is not doneMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.common.base.Function
equals
-
Field Details
-
delegate
-
layouts
-
-
Constructor Details
-
AggregateLayout
Creates an instance backed by the specifieddelegate
.- Parameters:
delegate
- the layout to which this instance is delegating
-
-
Method Details
-
getDelegate
- Returns:
- the delegate
-
setDelegate
- Parameters:
delegate
- the delegate to set
-
put
Adds the passed layout as a sublayout, and specifies the center of where this sublayout should appear.- Parameters:
layout
- the layout algorithm to use as a sublayoutcenter
- the center of the coordinates for the sublayout
-
get
- Parameters:
layout
- the layout whose center is to be returned- Returns:
- the center of the passed layout
-
remove
Removeslayout
from this instance.- Parameters:
layout
- the layout to remove
-
removeAll
public void removeAll()Removes all layouts from this instance. -
getGraph
-
getSize
-
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>
-
isLocked
-
lock
Locks this vertex in the main layout and in any sublayouts whose graph contains this vertex. -
reset
public void reset() -
setGraph
-
setInitializer
- Specified by:
setInitializer
in interfaceLayout<V,
E> - Parameters:
initializer
- a function that specifies initial locations for all vertices
-
setLocation
Description copied from interface:Layout
Changes the layout coordinates ofv
tolocation
.- Specified by:
setLocation
in interfaceLayout<V,
E> - Parameters:
v
- the vertex whose location is to be specifiedlocation
- the coordinates of the specified location
-
setSize
-
getLayouts
- Returns:
- a map from each
Layout
instance to its center point.
-
apply
Returns the location of the vertex. The location is specified first by the sublayouts, and then by the base layout if no sublayouts operate on this vertex. -
done
public boolean done()- Specified by:
done
in interfaceIterativeContext
- Returns:
true
iff the delegate layout and all sublayouts are done
-
step
public void step()Call step on any sublayout that is also an IterativeContext and is not done- Specified by:
step
in interfaceIterativeContext
-