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.
-
-
Constructor Summary
Constructors Constructor and Description mxHierarchicalLayout(mxGraph graph)Constructs a hierarchical layoutmxHierarchicalLayout(mxGraph graph, int orientation)Constructs a hierarchical layout
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcrossingStage(java.lang.Object parent)Executes the crossing stage using mxMedianHybridCrossingReduction.voidcycleStage(java.lang.Object parent)Executes the cycle stage.voidexecute(java.lang.Object parent)Executes the layout for the children of the specified parent.voidexecute(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 cellsjava.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)doublegetInterHierarchySpacing()doublegetInterRankCellSpacing()doublegetIntraCellSpacing()mxGraphHierarchyModelgetModel()Returns the model for this layout algorithm.intgetOrientation()doublegetParallelEdgeSpacing()intgetParentBorder()Returns parentBorder.booleanisDisableEdgeStyle()booleanisFineTuning()booleanisMoveParent()Returns the moveParent flag.booleanisResizeParent()Returns the resizeParent flag.voidlayeringStage()Implements first stage of a Sugiyama layout.doubleplacementStage(double initialX, java.lang.Object parent)Executes the placement stage using mxCoordinateAssignment.voidrun(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.voidsetDisableEdgeStyle(boolean disableEdgeStyle)voidsetFineTuning(boolean fineTuning)voidsetInterHierarchySpacing(double interHierarchySpacing)voidsetInterRankCellSpacing(double interRankCellSpacing)voidsetIntraCellSpacing(double intraCellSpacing)voidsetLoggerLevel(java.util.logging.Level level)Sets the logging level of this classvoidsetMoveParent(boolean value)Sets the moveParent flag.voidsetOrientation(int orientation)voidsetParallelEdgeSpacing(double parallelEdgeSpacing)voidsetParentBorder(int value)Sets parentBorder.voidsetResizeParent(boolean value)Sets the resizeParent flag.java.lang.StringtoString()ReturnsHierarchical, the name of this algorithm.-
Methods inherited from class com.mxgraph.layout.mxGraphLayout
arrangeGroups, getConstraint, getConstraint, getGraph, getParentOffset, getVertexBounds, isEdgeIgnored, isUseBoundingBox, isVertexIgnored, isVertexMovable, moveCell, setEdgePoints, setEdgeStyleEnabled, setOrthogonalEdge, setUseBoundingBox, setVertexLocation
-
-
-
-
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 outorientation-SwingConstants.NORTH, SwingConstants.EAST, SwingConstants.SOUTHorSwingConstants.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.- Specified by:
executein interfacemxIGraphLayout- Overrides:
executein classmxGraphLayout- Parameters:
parent- Parent cell that contains the children to be laid out.
-
execute
public void execute(java.lang.Object parent, java.util.List<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
-
findRoots
public 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. If the result is empty then the children with the maximum difference between incoming and outgoing edges are returned. This takes into account edges that are being promoted to the given root due to invisible children or collapsed cells.- Parameters:
parent- Cell whose children should be checked.- Returns:
- List of tree roots in parent.
-
getEdges
public java.lang.Object[] getEdges(java.lang.Object cell)
- Parameters:
cell-- Returns:
-
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.
-
filterDescendants
public java.util.Set<java.lang.Object> filterDescendants(java.lang.Object cell)
Creates a set of descendant cells- Parameters:
cell- The cell whose descendants are to be calculated- Returns:
- the descendants of the cell (not the cell)
-
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-
-
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()
ReturnsHierarchical, the name of this algorithm.- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG