public abstract class GraphLayout<N,E> extends Object
Internally the invoked method creates an UniversalGraph from the scene in the arguments. Then it calls the particular (performGraphLayout or performNodesLayout) methods with the UniversalGraph as a parameter. These protected methods are implemented by the GraphLayout based class and performs particular layout using an UniversalGraph.
| Constructor and Description |
|---|
GraphLayout() |
| Modifier and Type | Method and Description |
|---|---|
void |
addGraphLayoutListener(GraphLayoutListener<N,E> listener)
Adds a graph layout listener.
|
boolean |
isAnimated()
Returns whether the layout uses animations.
|
void |
layoutGraph(GraphPinScene<N,E,?> graphPinScene)
Invokes graph-oriented layout on a GraphPinScene.
|
void |
layoutGraph(GraphScene<N,E> graphScene)
Invokes graph-oriented layout on a GraphScene.
|
void |
layoutNodes(GraphPinScene<N,E,?> graphPinScene,
Collection<N> nodes)
Invokes resolving of locations for a collection of nodes in a GraphPinScene.
|
void |
layoutNodes(GraphScene<N,E> graphScene,
Collection<N> nodes)
Invokes resolving of locations for a collection of nodes in a GraphScene.
|
protected abstract void |
performGraphLayout(UniversalGraph<N,E> graph)
Implements and performs particular graph-oriented algorithm of a UniversalGraph.
|
protected abstract void |
performNodesLayout(UniversalGraph<N,E> graph,
Collection<N> nodes)
Implements and performs particular location resolution of a collection of nodes in a UniversalGraph.
|
void |
removeGraphLayoutListener(GraphLayoutListener<N,E> listener)
Removes a graph layout listener.
|
void |
setAnimated(boolean animated)
Sets whether the layout is animated.
|
protected void |
setResolvedNodeLocation(UniversalGraph<N,E> graph,
N node,
Point newPreferredLocation)
Should be called to set a new resolved preferred location of a node.
|
public final boolean isAnimated()
public final void setAnimated(boolean animated)
animated - if true, then the layout is animatedpublic final void addGraphLayoutListener(GraphLayoutListener<N,E> listener)
listener - the graph layout listenerpublic final void removeGraphLayoutListener(GraphLayoutListener<N,E> listener)
listener - the graph layout listenerpublic final void layoutGraph(GraphScene<N,E> graphScene)
graphScene - the graph scenepublic final void layoutGraph(GraphPinScene<N,E,?> graphPinScene)
graphPinScene - the graph pin scenepublic final void layoutNodes(GraphScene<N,E> graphScene, Collection<N> nodes)
graphScene - the graph scenenodes - the collection of nodes to resolvepublic final void layoutNodes(GraphPinScene<N,E,?> graphPinScene, Collection<N> nodes)
graphPinScene - the graph pin scenenodes - the collection of nodes to resolveprotected final void setResolvedNodeLocation(UniversalGraph<N,E> graph, N node, Point newPreferredLocation)
graph - the universal graphnode - the node with resolved locationnewPreferredLocation - the new resolved locationprotected abstract void performGraphLayout(UniversalGraph<N,E> graph)
GraphLayout.setResolvedNodeLocation method for setting the resolved node location.graph - the universal graph on which the layout should be performedprotected abstract void performNodesLayout(UniversalGraph<N,E> graph, Collection<N> nodes)
GraphLayout.setResolvedNodeLocation method for setting the resolved node location.graph - the universal graph on which the nodes should be resolvednodes - the collection of nodes to be resolvedBuilt on August 24 2014. | Portions Copyright 1997-2014 Sun Microsystems, Inc. All rights reserved.