public class mxHierarchicalLayout extends mxGraphLayout
Modifier and Type | Field and Description |
---|---|
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 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 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.util.List<java.lang.Object> |
roots
The root nodes of the layout
|
protected boolean |
traverseAncestors
Whether or not to navigate edges whose terminal vertices
have different parents but are in the same ancestry chain
|
graph, parent, useBoundingBox
Constructor and Description |
---|
mxHierarchicalLayout(mxGraph graph)
Constructs a hierarchical layout
|
mxHierarchicalLayout(mxGraph graph,
int orientation)
Constructs a hierarchical layout
|
Modifier and Type | Method and Description |
---|---|
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.util.List<java.lang.Object> roots)
Executes the layout for the children of the specified parent.
|
java.util.Set<java.lang.Object> |
filterDescendants(java.lang.Object cell)
Creates a set of descendant cells
|
java.util.List<java.lang.Object> |
findRoots(java.lang.Object parent,
java.util.Set<java.lang.Object> vertices)
Returns all visible children in the given parent which do not have
incoming edges.
|
java.lang.Object[] |
getEdges(java.lang.Object cell) |
double |
getInterHierarchySpacing() |
double |
getInterRankCellSpacing() |
double |
getIntraCellSpacing() |
mxGraphHierarchyModel |
getModel()
Returns the model for this layout algorithm.
|
int |
getOrientation() |
double |
getParallelEdgeSpacing() |
int |
getParentBorder()
Returns parentBorder.
|
boolean |
isDisableEdgeStyle() |
boolean |
isFineTuning() |
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 |
setDisableEdgeStyle(boolean disableEdgeStyle) |
void |
setFineTuning(boolean fineTuning) |
void |
setInterHierarchySpacing(double interHierarchySpacing) |
void |
setInterRankCellSpacing(double interRankCellSpacing) |
void |
setIntraCellSpacing(double intraCellSpacing) |
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. |
protected void |
traverse(java.lang.Object vertex,
boolean directed,
java.lang.Object edge,
java.util.Set<java.lang.Object> allVertices,
java.util.Set<java.lang.Object> currentComp,
java.util.List<java.util.Set<java.lang.Object>> hierarchyVertices,
java.util.Set<java.lang.Object> filledVertexSet)
Traverses the (directed) graph invoking the given function for each
visited vertex and edge.
|
arrangeGroups, getConstraint, getConstraint, getGraph, getParentOffset, getVertexBounds, isEdgeIgnored, isUseBoundingBox, isVertexIgnored, isVertexMovable, moveCell, setEdgePoints, setEdgeStyleEnabled, setOrthogonalEdge, setUseBoundingBox, setVertexLocation
protected java.util.List<java.lang.Object> roots
protected boolean resizeParent
protected boolean moveParent
protected int parentBorder
protected double intraCellSpacing
protected double interRankCellSpacing
protected double interHierarchySpacing
protected double parallelEdgeSpacing
protected int orientation
SwingConstants.NORTH
, i.e. top-down.protected boolean disableEdgeStyle
protected boolean fineTuning
protected boolean traverseAncestors
protected mxGraphHierarchyModel model
public mxHierarchicalLayout(mxGraph graph)
graph
- the graph to lay outpublic mxHierarchicalLayout(mxGraph graph, int orientation)
graph
- the graph to lay outorientation
- SwingConstants.NORTH, SwingConstants.EAST, SwingConstants.SOUTH
or SwingConstants.WEST
public mxGraphHierarchyModel getModel()
public void execute(java.lang.Object parent)
execute
in interface mxIGraphLayout
execute
in class mxGraphLayout
parent
- Parent cell that contains the children to be laid out.public void execute(java.lang.Object parent, java.util.List<java.lang.Object> roots)
parent
- Parent cell that contains the children to be laid out.roots
- the starting roots of the layoutpublic java.util.List<java.lang.Object> findRoots(java.lang.Object parent, java.util.Set<java.lang.Object> vertices)
parent
- Cell whose children should be checked.public java.lang.Object[] getEdges(java.lang.Object cell)
cell
- public void run(java.lang.Object parent)
public java.util.Set<java.lang.Object> filterDescendants(java.lang.Object cell)
cell
- The cell whose descendants are to be calculatedprotected void traverse(java.lang.Object vertex, boolean directed, java.lang.Object edge, java.util.Set<java.lang.Object> allVertices, java.util.Set<java.lang.Object> currentComp, java.util.List<java.util.Set<java.lang.Object>> hierarchyVertices, java.util.Set<java.lang.Object> filledVertexSet)
vertex
- directed
- Optional boolean indicating if edges should only be traversed
from source to target. Default is true.edge
- Optional allVertices
- Array of cell paths for the visited cells.public void cycleStage(java.lang.Object parent)
public void layeringStage()
public void crossingStage(java.lang.Object parent)
public double placementStage(double initialX, java.lang.Object parent)
public boolean isResizeParent()
public void setResizeParent(boolean value)
public boolean isMoveParent()
public void setMoveParent(boolean value)
public int getParentBorder()
public void setParentBorder(int value)
public double getIntraCellSpacing()
public void setIntraCellSpacing(double intraCellSpacing)
intraCellSpacing
- The intraCellSpacing to set.public double getInterRankCellSpacing()
public void setInterRankCellSpacing(double interRankCellSpacing)
interRankCellSpacing
- The interRankCellSpacing to set.public int getOrientation()
public void setOrientation(int orientation)
orientation
- The orientation to set.public double getInterHierarchySpacing()
public void setInterHierarchySpacing(double interHierarchySpacing)
interHierarchySpacing
- The interHierarchySpacing to set.public double getParallelEdgeSpacing()
public void setParallelEdgeSpacing(double parallelEdgeSpacing)
public boolean isFineTuning()
public void setFineTuning(boolean fineTuning)
fineTuning
- The fineTuning to set.public boolean isDisableEdgeStyle()
public void setDisableEdgeStyle(boolean disableEdgeStyle)
disableEdgeStyle
- public void setLoggerLevel(java.util.logging.Level level)
level
- the logging level to setpublic java.lang.String toString()
Hierarchical
, the name of this algorithm.toString
in class java.lang.Object
Copyright (c) 2010-2017 Gaudenz Alder, JGraph Ltd. All rights reserved.