com.mxgraph.layout
Class mxCompactTreeLayout
- java.lang.Object
-
- com.mxgraph.layout.mxGraphLayout
-
- com.mxgraph.layout.mxCompactTreeLayout
-
- All Implemented Interfaces:
- mxIGraphLayout
public class mxCompactTreeLayout extends mxGraphLayout
-
-
Constructor Summary
Constructors Constructor and Description mxCompactTreeLayout(mxGraph graph)mxCompactTreeLayout(mxGraph graph, boolean horizontal)mxCompactTreeLayout(mxGraph graph, boolean horizontal, boolean invert)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidexecute(java.lang.Object parent)Executes the layout for the children of the specified parent.voidexecute(java.lang.Object parent, java.lang.Object root)Implements. java.util.List<java.lang.Object>findTreeRoots(java.lang.Object parent, boolean invert)Returns all visible children in the given parent which do not have incoming edges.doublegetGroupPadding()intgetLevelDistance()intgetNodeDistance()booleanisEdgeRouting()booleanisHorizontal()booleanisInvert()booleanisMoveTree()booleanisResetEdges()booleanisResizeParent()booleanisVertexIgnored(java.lang.Object vertex)Returns a boolean indicating if the givenshould be ignored as a vertex. voidsetEdgeRouting(boolean edgeRouting)voidsetGroupPadding(int groupPadding)voidsetHorizontal(boolean horizontal)voidsetInvert(boolean invert)voidsetLevelDistance(int levelDistance)voidsetMoveTree(boolean moveTree)voidsetNodeDistance(int nodeDistance)voidsetResetEdges(boolean resetEdges)voidsetResizeParent(boolean resizeParent)-
Methods inherited from class com.mxgraph.layout.mxGraphLayout
arrangeGroups, getConstraint, getConstraint, getGraph, getParentOffset, getVertexBounds, isEdgeIgnored, isUseBoundingBox, isVertexMovable, moveCell, setEdgePoints, setEdgeStyleEnabled, setOrthogonalEdge, setUseBoundingBox, setVertexLocation
-
-
-
-
Constructor Detail
-
mxCompactTreeLayout
public mxCompactTreeLayout(mxGraph graph)
- Parameters:
graph-
-
mxCompactTreeLayout
public mxCompactTreeLayout(mxGraph graph, boolean horizontal)
- Parameters:
graph-horizontal-
-
mxCompactTreeLayout
public mxCompactTreeLayout(mxGraph graph, boolean horizontal, boolean invert)
- Parameters:
graph-horizontal-invert-
-
-
Method Detail
-
isVertexIgnored
public boolean isVertexIgnored(java.lang.Object vertex)
Returns a boolean indicating if the givenshould be ignored as a vertex. This returns true if the cell has no connections. - Overrides:
isVertexIgnoredin classmxGraphLayout- Parameters:
vertex- Object that represents the vertex to be tested.- Returns:
- Returns true if the vertex should be ignored.
-
isHorizontal
public boolean isHorizontal()
- Returns:
- the horizontal
-
setHorizontal
public void setHorizontal(boolean horizontal)
- Parameters:
horizontal- the horizontal to set
-
isInvert
public boolean isInvert()
- Returns:
- the invert
-
setInvert
public void setInvert(boolean invert)
- Parameters:
invert- the invert to set
-
isResizeParent
public boolean isResizeParent()
- Returns:
- the resizeParent
-
setResizeParent
public void setResizeParent(boolean resizeParent)
- Parameters:
resizeParent- the resizeParent to set
-
isMoveTree
public boolean isMoveTree()
- Returns:
- the moveTree
-
setMoveTree
public void setMoveTree(boolean moveTree)
- Parameters:
moveTree- the moveTree to set
-
isResetEdges
public boolean isResetEdges()
- Returns:
- the resetEdges
-
setResetEdges
public void setResetEdges(boolean resetEdges)
- Parameters:
resetEdges- the resetEdges to set
-
isEdgeRouting
public boolean isEdgeRouting()
-
setEdgeRouting
public void setEdgeRouting(boolean edgeRouting)
-
getLevelDistance
public int getLevelDistance()
- Returns:
- the levelDistance
-
setLevelDistance
public void setLevelDistance(int levelDistance)
- Parameters:
levelDistance- the levelDistance to set
-
getNodeDistance
public int getNodeDistance()
- Returns:
- the nodeDistance
-
setNodeDistance
public void setNodeDistance(int nodeDistance)
- Parameters:
nodeDistance- the nodeDistance to set
-
getGroupPadding
public double getGroupPadding()
-
setGroupPadding
public void setGroupPadding(int groupPadding)
-
execute
public void execute(java.lang.Object parent)
Description copied from interface:mxIGraphLayoutExecutes 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 layed out.
-
execute
public void execute(java.lang.Object parent, java.lang.Object root)Implements. If the parent has any connected edges, then it is used as the root of the tree. Else, will be used to find a suitable root node within the set of children of the given parent.
-
findTreeRoots
public java.util.List<java.lang.Object> findTreeRoots(java.lang.Object parent, boolean invert)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.invert- Specifies if outgoing or incoming edges should be counted for a tree root. If false then outgoing edges will be counted.- Returns:
- List of tree roots in parent.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG