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>

public class TreeGraphLayout<N,E> extends GraphLayout<N,E>
This class supplies the tree graph-oriented layout for a GraphScene.
  • 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 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 Details

    • 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<N,E> 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<N,E>
      Parameters:
      graph - the universal graph on which the layout should be performed
    • performNodesLayout

      protected void performNodesLayout(UniversalGraph<N,E> graph, Collection<N> 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<N,E>
      Parameters:
      graph - the universal graph on which the nodes should be resolved
      nodes - the collection of nodes to be resolved