JGraph X 1.3.0.0

## com.mxgraph.layout.hierarchical
Class mxHierarchicalLayout

    java.lang.Object
      com.mxgraph.layout.mxGraphLayout
          com.mxgraph.layout.hierarchical.mxHierarchicalLayout

All Implemented Interfaces:
  mxIGraphLayout

    public class mxHierarchicalLayout

extends mxGraphLayout

The top level compound layout of the hierarchical layout. The individual elements of the layout are called in sequence.

Field Summary
`protected boolean` `deterministic` Whether or not cells are ordered according to the order in the graph model.
`protected boolean` `disableEdgeStyle` Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result.
`protected boolean` `fineTuning` Whether or not to perform local optimisations and iterate multiple times through the algorithm
`protected boolean` `fixRoots` Whether or not to fix the position of the root cells.
`protected double` `interHierarchySpacing` The spacing buffer between unconnected hierarchies
`protected double` `interRankCellSpacing` The spacing buffer added between cell on adjacent layers
`protected double` `intraCellSpacing` The spacing buffer added between cells on the same layer
`protected boolean` `layoutFromSinks` Whether or not the initial scan of the graph to determine the layer assigned to each vertex starts from the sinks or source (the sinks being vertices with the fewest, preferable zero, outgoing edges and sources same with incoming edges).
`protected mxGraphHierarchyModel` `model` The internal model formed of the layout
`protected boolean` `moveParent` Specifies if the parnent should be moved if resizeParent is enabled.
`protected int` `orientation` The position of the root node(s) relative to the laid out graph in.
`protected double` `parallelEdgeSpacing` The distance between each parallel edge on each ranks for long edges
`protected int` `parentBorder` The border to be added around the children if the parent is to be resized using resizeParent.
`protected boolean` `resizeParent` Specifies if the parent should be resized after the layout so that it contains all the child cells.
`protected java.lang.Object[]` `roots` The root nodes of the layout

Fields inherited from class com.mxgraph.layout.mxGraphLayout
`graph, useBoundingBox`

Constructor Summary
`mxHierarchicalLayout(mxGraph graph)` Constructs a hierarchical layout
`mxHierarchicalLayout(mxGraph graph, int orientation)` Constructs a hierarchical layout

Method Summary
`void` `crossingStage(java.lang.Object parent)` Executes the crossing stage using mxMedianHybridCrossingReduction.
`void` `cycleStage(java.lang.Object parent)` Executes the cycle stage.
`void` `execute(java.lang.Object parent)` Executes the layout for the children of the specified parent.
`void` `execute(java.lang.Object parent, java.lang.Object[] roots)` Executes the layout for the children of the specified parent.
`double` `getInterHierarchySpacing()`
`double` `getInterRankCellSpacing()`
`double` `getIntraCellSpacing()`
`mxGraphHierarchyModel` `getModel()` Returns the model for this layout algorithm.
`int` `getOrientation()`
`double` `getParallelEdgeSpacing()`
`int` `getParentBorder()` Returns parentBorder.
`boolean` `isDeterministic()`
`boolean` `isDisableEdgeStyle()`
`boolean` `isFineTuning()`
`boolean` `isFixRoots()`
`boolean` `isLayoutFromSinks()`
`boolean` `isMoveParent()` Returns the moveParent flag.
`boolean` `isResizeParent()` Returns the resizeParent flag.
`void` `layeringStage()` Implements first stage of a Sugiyama layout.
`double` `placementStage(double initialX, java.lang.Object parent)` Executes the placement stage using mxCoordinateAssignment.
`void` `run(java.lang.Object parent)` The API method used to exercise the layout upon the graph description and produce a separate description of the vertex position and edge routing changes made.
`void` `setDeterministic(boolean deterministic)`
`void` `setDisableEdgeStyle(boolean disableEdgeStyle)`
`void` `setFineTuning(boolean fineTuning)`
`void` `setFixRoots(boolean fixRoots)`
`void` `setInterHierarchySpacing(double interHierarchySpacing)`
`void` `setInterRankCellSpacing(double interRankCellSpacing)`
`void` `setIntraCellSpacing(double intraCellSpacing)`
`void` `setLayoutFromSinks(boolean layoutFromSinks)`
`void` `setLoggerLevel(java.util.logging.Level level)` Sets the logging level of this class
`void` `setMoveParent(boolean value)` Sets the moveParent flag.
`void` `setOrientation(int orientation)`
`void` `setParallelEdgeSpacing(double parallelEdgeSpacing)`
`void` `setParentBorder(int value)` Sets parentBorder.
`void` `setResizeParent(boolean value)` Sets the resizeParent flag.
`java.lang.String` `toString()` Returns `Hierarchical`, the name of this algorithm.

Methods inherited from class com.mxgraph.layout.mxGraphLayout
`getConstraint, getConstraint, getGraph, getVertexBounds, isEdgeIgnored, isUseBoundingBox, isVertexIgnored, isVertexMovable, moveCell, setEdgePoints, setEdgeStyleEnabled, setUseBoundingBox, setVertexLocation`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### roots

    protected java.lang.Object[] roots

  The root nodes of the layout

### resizeParent

    protected boolean resizeParent

  Specifies if the parent should be resized after the layout so that it contains all the child cells. Default is false. @See parentBorder.

### moveParent

    protected boolean moveParent

  Specifies if the parnent should be moved if resizeParent is enabled. Default is false. @See resizeParent.

### parentBorder

    protected int parentBorder

  The border to be added around the children if the parent is to be resized using resizeParent. Default is 0. @See resizeParent.

### intraCellSpacing

    protected double intraCellSpacing

  The spacing buffer added between cells on the same layer

### interRankCellSpacing

    protected double interRankCellSpacing

  The spacing buffer added between cell on adjacent layers

### interHierarchySpacing

    protected double interHierarchySpacing

  The spacing buffer between unconnected hierarchies

### parallelEdgeSpacing

    protected double parallelEdgeSpacing

  The distance between each parallel edge on each ranks for long edges

### orientation

    protected int orientation

  The position of the root node(s) relative to the laid out graph in. Default is `SwingConstants.NORTH`, i.e. top-down.

### disableEdgeStyle

    protected boolean disableEdgeStyle

  Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are modified by the result. Default is true.

### fineTuning

    protected boolean fineTuning

  Whether or not to perform local optimisations and iterate multiple times through the algorithm

### deterministic

    protected boolean deterministic

  Whether or not cells are ordered according to the order in the graph model. Defaults to false since sorting usually produces quadratic performance. Note that since mxGraph returns edges in a deterministic order, it might be that this layout is always deterministic using that JGraph regardless of this flag setting (i.e. leave it false in that case). Default is true.

### fixRoots

    protected boolean fixRoots

  Whether or not to fix the position of the root cells. Keep in mind to turn off features such as move to origin when fixing the roots, move to origin usually overrides this flag (in JGraph it does).

### layoutFromSinks

    protected boolean layoutFromSinks

  Whether or not the initial scan of the graph to determine the layer assigned to each vertex starts from the sinks or source (the sinks being vertices with the fewest, preferable zero, outgoing edges and sources same with incoming edges). Starting from either direction can tight the layout up and also produce better results for certain types of graphs. If the result for the default is not good enough try a few sample layouts with the value false to see if they improve

### model

    protected mxGraphHierarchyModel model

  The internal model formed of the layout

Constructor Detail

### mxHierarchicalLayout

    public mxHierarchicalLayout(mxGraph graph)

  Constructs a hierarchical layout

  Parameters:
    `graph` - the graph to lay out

### mxHierarchicalLayout

    public mxHierarchicalLayout(mxGraph graph,
                                int orientation)

  Constructs a hierarchical layout

  Parameters:
    `graph` - the graph to lay out
    `orientation` - `SwingConstants.NORTH, SwingConstants.EAST, SwingConstants.SOUTH` or `SwingConstants.WEST`

Method Detail

### getModel

    public mxGraphHierarchyModel getModel()

  Returns the model for this layout algorithm.

### execute

    public void execute(java.lang.Object parent)

  Executes the layout for the children of the specified parent.

  Parameters:
    `parent` - Parent cell that contains the children to be laid out.

### execute

    public void execute(java.lang.Object parent,
                        java.lang.Object[] roots)

  Executes the layout for the children of the specified parent.

  Parameters:
    `parent` - Parent cell that contains the children to be laid out.
    `roots` - the starting roots of the layout

### run

    public void run(java.lang.Object parent)

  The API method used to exercise the layout upon the graph description and produce a separate description of the vertex position and edge routing changes made.

### cycleStage

    public void cycleStage(java.lang.Object parent)

  Executes the cycle stage. This implementation uses the mxMinimumCycleRemover.

### layeringStage

    public void layeringStage()

  Implements first stage of a Sugiyama layout.

### crossingStage

    public void crossingStage(java.lang.Object parent)

  Executes the crossing stage using mxMedianHybridCrossingReduction.

### placementStage

    public double placementStage(double initialX,
                                 java.lang.Object parent)

  Executes the placement stage using mxCoordinateAssignment.

### isResizeParent

    public boolean isResizeParent()

  Returns the resizeParent flag.

### setResizeParent

    public void setResizeParent(boolean value)

  Sets the resizeParent flag.

### isMoveParent

    public boolean isMoveParent()

  Returns the moveParent flag.

### setMoveParent

    public void setMoveParent(boolean value)

  Sets the moveParent flag.

### getParentBorder

    public int getParentBorder()

  Returns parentBorder.

### setParentBorder

    public void setParentBorder(int value)

  Sets parentBorder.

### getIntraCellSpacing

    public double getIntraCellSpacing()

  Returns:
    Returns the intraCellSpacing.

### setIntraCellSpacing

    public void setIntraCellSpacing(double intraCellSpacing)

  Parameters:
    `intraCellSpacing` - The intraCellSpacing to set.

### getInterRankCellSpacing

    public double getInterRankCellSpacing()

  Returns:
    Returns the interRankCellSpacing.

### setInterRankCellSpacing

    public void setInterRankCellSpacing(double interRankCellSpacing)

  Parameters:
    `interRankCellSpacing` - The interRankCellSpacing to set.

### getOrientation

    public int getOrientation()

  Returns:
    Returns the orientation.

### setOrientation

    public void setOrientation(int orientation)

  Parameters:
    `orientation` - The orientation to set.

### getInterHierarchySpacing

    public double getInterHierarchySpacing()

  Returns:
    Returns the interHierarchySpacing.

### setInterHierarchySpacing

    public void setInterHierarchySpacing(double interHierarchySpacing)

  Parameters:
    `interHierarchySpacing` - The interHierarchySpacing to set.

### getParallelEdgeSpacing

    public double getParallelEdgeSpacing()

### setParallelEdgeSpacing

    public void setParallelEdgeSpacing(double parallelEdgeSpacing)

### isFineTuning

    public boolean isFineTuning()

  Returns:
    Returns the fineTuning.

### setFineTuning

    public void setFineTuning(boolean fineTuning)

  Parameters:
    `fineTuning` - The fineTuning to set.

### isDisableEdgeStyle

    public boolean isDisableEdgeStyle()

### setDisableEdgeStyle

    public void setDisableEdgeStyle(boolean disableEdgeStyle)

  Parameters:
    `disableEdgeStyle` -

### isDeterministic

    public boolean isDeterministic()

  Returns:
    Returns the deterministic.

### setDeterministic

    public void setDeterministic(boolean deterministic)

  Parameters:
    `deterministic` - The deterministic to set.

### isFixRoots

    public boolean isFixRoots()

  Returns:
    Returns the fixRoots.

### setFixRoots

    public void setFixRoots(boolean fixRoots)

  Parameters:
    `fixRoots` - The fixRoots to set.

### isLayoutFromSinks

    public boolean isLayoutFromSinks()

### setLayoutFromSinks

    public void setLayoutFromSinks(boolean layoutFromSinks)

### setLoggerLevel

    public void setLoggerLevel(java.util.logging.Level level)

  Sets the logging level of this class

  Parameters:
    `level` - the logging level to set

### toString

    public java.lang.String toString()

  Returns `Hierarchical`, the name of this algorithm.

  Overrides:
    `toString` in class `java.lang.Object`

JGraph X 1.3.0.0

Copyright (c) 2008 Gaudenz Alder. All rights reserved.