Class TreeGraphLayout<N,E>
java.lang.Object
org.netbeans.api.visual.graph.layout.GraphLayout<N,E>
org.netbeans.api.visual.graph.layout.TreeGraphLayout<N,E>
This class supplies the tree graph-oriented layout for a GraphScene.
-
Constructor Summary
ConstructorsConstructorDescriptionTreeGraphLayout
(GraphScene<N, E> scene, int originX, int originY, int verticalGap, int horizontalGap, boolean vertical) Creates a graph-oriented tree layout. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Invokes the layout for a specified root node.protected void
performGraphLayout
(UniversalGraph<N, E> graph) Implements and performs particular graph-oriented algorithm of a UniversalGraph.protected void
performNodesLayout
(UniversalGraph<N, E> graph, Collection<N> nodes) Implements and performs particular location resolution of a collection of nodes in a UniversalGraph.protected Collection
<N> resolveChildren
(N node) Collects a collection of children nodes of a specified node.Methods inherited from class org.netbeans.api.visual.graph.layout.GraphLayout
addGraphLayoutListener, isAnimated, layoutGraph, layoutGraph, layoutNodes, layoutNodes, removeGraphLayoutListener, setAnimated, setResolvedNodeLocation
-
Constructor Details
-
TreeGraphLayout
public TreeGraphLayout(GraphScene<N, E> scene, int originX, int originY, int verticalGap, int horizontalGap, boolean vertical) Creates a graph-oriented tree layout.- Parameters:
scene
- the GraphScene where the layout is usedoriginX
- the x-axis originoriginY
- the y-axis originverticalGap
- the vertical gap between cellshorizontalGap
- the horizontal gap between cellsvertical
- if true, then layout organizes the graph vertically; if false, then horizontally
-
-
Method Details
-
layout
Invokes the layout for a specified root node.- Parameters:
rootNode
- the root node
-
resolveChildren
Collects a collection of children nodes of a specified node.- Parameters:
node
- the node- Returns:
- the collection of children
-
performGraphLayout
Description copied from class:GraphLayout
Implements and performs particular graph-oriented algorithm of a UniversalGraph. CallGraphLayout.setResolvedNodeLocation
method for setting the resolved node location.- Specified by:
performGraphLayout
in classGraphLayout<N,
E> - Parameters:
graph
- the universal graph on which the layout should be performed
-
performNodesLayout
Description copied from class:GraphLayout
Implements and performs particular location resolution of a collection of nodes in a UniversalGraph. CallGraphLayout.setResolvedNodeLocation
method for setting the resolved node location.- Specified by:
performNodesLayout
in classGraphLayout<N,
E> - Parameters:
graph
- the universal graph on which the nodes should be resolvednodes
- the collection of nodes to be resolved
-