org.netbeans.api.visual 2.21.1

org.netbeans.api.visual.graph.layout
Class TreeGraphLayout<N,E>

java.lang.Object
  extended by org.netbeans.api.visual.graph.layout.GraphLayout
      extended by org.netbeans.api.visual.graph.layout.TreeGraphLayout<N,E>

public class TreeGraphLayout<N,E>
extends GraphLayout

This class supplies the tree graph-oriented layout for a GraphScene.


Constructor Summary
TreeGraphLayout(GraphScene<N,E> scene, int originX, int originY, int verticalGap, int horizontalGap, boolean vertical)
          Creates a graph-oriented tree layout.
 
Method Summary
 void layout(N rootNode)
          Invokes the layout for a specified root node.
protected  void performGraphLayout(UniversalGraph graph)
          Implements and performs particular graph-oriented algorithm of a UniversalGraph.
protected  void performNodesLayout(UniversalGraph graph, Collection 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 used
originX - the x-axis origin
originY - the y-axis origin
verticalGap - the vertical gap between cells
horizontalGap - the horizontal gap between cells
vertical - if true, then layout organizes the graph vertically; if false, then horizontally
Method Detail

layout

public final void layout(N rootNode)
Invokes the layout for a specified root node.

Parameters:
rootNode - the root node

resolveChildren

protected Collection<N> resolveChildren(N node)
Collects a collection of children nodes of a specified node.

Parameters:
node - the node
Returns:
the collection of children

performGraphLayout

protected void performGraphLayout(UniversalGraph graph)
Description copied from class: GraphLayout
Implements and performs particular graph-oriented algorithm of a UniversalGraph. Call GraphLayout.setResolvedNodeLocation method for setting the resolved node location.

Specified by:
performGraphLayout in class GraphLayout
Parameters:
graph - the universal graph on which the layout should be performed

performNodesLayout

protected void performNodesLayout(UniversalGraph graph,
                                  Collection nodes)
Description copied from class: GraphLayout
Implements and performs particular location resolution of a collection of nodes in a UniversalGraph. Call GraphLayout.setResolvedNodeLocation method for setting the resolved node location.

Specified by:
performNodesLayout in class GraphLayout
Parameters:
graph - the universal graph on which the nodes should be resolved
nodes - the collection of nodes to be resolved

org.netbeans.api.visual 2.21.1

Built on February 22 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.