Package org.activiti.bpmn
Class BPMNLayout
java.lang.Object
com.mxgraph.layout.mxGraphLayout
org.activiti.bpmn.BPMNLayout
- All Implemented Interfaces:
com.mxgraph.layout.mxIGraphLayout
public class BPMNLayout
extends com.mxgraph.layout.mxGraphLayout
BPMNLayout
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BpmnAutoLayoutprotected booleanSpecifies the orientation of the layout.protected booleanSpecifies if edge directions should be inverted.protected intHolds the levelDistance.protected booleanSpecifies if the tree should be moved to the top, left corner if it is inside a top-level layer.protected intHolds the nodeDistance.protected booleanSpecifies if all edge points of traversed edges should be removed.protected booleanIf the parent should be resized to match the width/height of the tree.Fields inherited from class com.mxgraph.layout.mxGraphLayout
graph, parent, useBoundingBox -
Constructor Summary
ConstructorsConstructorDescriptionBPMNLayout(com.mxgraph.view.mxGraph graph) BPMNLayout(com.mxgraph.view.mxGraph graph, boolean horizontal) BPMNLayout(com.mxgraph.view.mxGraph graph, boolean horizontal, boolean invert) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.mxgraph.util.mxRectangleapply(BPMNLayout.TreeNode node, com.mxgraph.util.mxRectangle bounds) protected voidattachParent(BPMNLayout.TreeNode node, double height) protected BPMNLayout.Polylinebridge(BPMNLayout.Polyline line1, double x1, double y1, BPMNLayout.Polyline line2, double x2, double y2) protected BPMNLayout.PolylinecreateLine(double dx, double dy, BPMNLayout.Polyline next) protected BPMNLayout.TreeNodecreateNode(Object cell) protected BPMNLayout.TreeNodeDoes a depth first search starting at the specified cell.voidcom.mxgraph.view.mxGraphgetGraph()intintprotected com.mxgraph.util.mxRectanglehorizontalLayout(BPMNLayout.TreeNode node, double x0, double y0, com.mxgraph.util.mxRectangle bounds) protected booleanisBoundaryEvent(Object obj) booleanbooleanisInvert()booleanbooleanbooleanbooleanisVertexIgnored(Object vertex) Returns a boolean indicating if the given mxCell should be ignored as a vertex.protected doublejoin(BPMNLayout.TreeNode node) protected voidlayout(BPMNLayout.TreeNode node) Starts the actual compact tree layout algorithm at the given node.protected voidprotected doubleprotected voidmoveNode(BPMNLayout.TreeNode node, double dx, double dy) Moves the specified node and all of its children by the given amount.protected doubleoffset(double p1, double p2, double a1, double a2, double b1, double b2) voidsetBpmnAutoLayout(BpmnAutoLayout bpmnAutoLayout) voidsetHorizontal(boolean horizontal) voidsetInvert(boolean invert) voidsetLevelDistance(int levelDistance) voidsetMoveTree(boolean moveTree) voidsetNodeDistance(int nodeDistance) voidsetResetEdges(boolean resetEdges) voidsetResizeParent(boolean resizeParent) protected com.mxgraph.util.mxRectangleverticalLayout(BPMNLayout.TreeNode node, Object parent, double x0, double y0, com.mxgraph.util.mxRectangle bounds) Methods inherited from class com.mxgraph.layout.mxGraphLayout
arrangeGroups, getConstraint, getConstraint, getParentOffset, getVertexBounds, isEdgeIgnored, isUseBoundingBox, isVertexMovable, moveCell, setEdgePoints, setEdgeStyleEnabled, setOrthogonalEdge, setUseBoundingBox, setVertexLocation
-
Field Details
-
bpmnAutoLayout
-
horizontal
protected boolean horizontalSpecifies the orientation of the layout. Default is true. -
invert
protected boolean invertSpecifies if edge directions should be inverted. Default is false. -
resizeParent
protected boolean resizeParentIf the parent should be resized to match the width/height of the tree. Default is true. -
moveTree
protected boolean moveTreeSpecifies if the tree should be moved to the top, left corner if it is inside a top-level layer. Default is true. -
resetEdges
protected boolean resetEdgesSpecifies if all edge points of traversed edges should be removed. Default is true. -
levelDistance
protected int levelDistanceHolds the levelDistance. Default is 40. -
nodeDistance
protected int nodeDistanceHolds the nodeDistance. Default is 20.
-
-
Constructor Details
-
BPMNLayout
public BPMNLayout(com.mxgraph.view.mxGraph graph) - Parameters:
graph-
-
BPMNLayout
public BPMNLayout(com.mxgraph.view.mxGraph graph, boolean horizontal) - Parameters:
graph-horizontal-
-
BPMNLayout
public BPMNLayout(com.mxgraph.view.mxGraph graph, boolean horizontal, boolean invert) - Parameters:
graph-horizontal-invert-
-
-
Method Details
-
setBpmnAutoLayout
-
getGraph
public com.mxgraph.view.mxGraph getGraph()- Overrides:
getGraphin classcom.mxgraph.layout.mxGraphLayout
-
isVertexIgnored
Returns a boolean indicating if the given mxCell should be ignored as a vertex. This returns true if the cell has no connections.- Overrides:
isVertexIgnoredin classcom.mxgraph.layout.mxGraphLayout- 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
-
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
-
execute
- Specified by:
executein interfacecom.mxgraph.layout.mxIGraphLayout- Overrides:
executein classcom.mxgraph.layout.mxGraphLayout
-
isBoundaryEvent
-
moveNode
Moves the specified node and all of its children by the given amount. -
dfs
Does a depth first search starting at the specified cell. Makes sure the specified swimlane is never left by the algorithm. -
layout
Starts the actual compact tree layout algorithm at the given node. -
horizontalLayout
protected com.mxgraph.util.mxRectangle horizontalLayout(BPMNLayout.TreeNode node, double x0, double y0, com.mxgraph.util.mxRectangle bounds) -
verticalLayout
protected com.mxgraph.util.mxRectangle verticalLayout(BPMNLayout.TreeNode node, Object parent, double x0, double y0, com.mxgraph.util.mxRectangle bounds) -
attachParent
-
layoutLeaf
-
join
-
merge
-
offset
protected double offset(double p1, double p2, double a1, double a2, double b1, double b2) -
bridge
protected BPMNLayout.Polyline bridge(BPMNLayout.Polyline line1, double x1, double y1, BPMNLayout.Polyline line2, double x2, double y2) -
createNode
-
apply
protected com.mxgraph.util.mxRectangle apply(BPMNLayout.TreeNode node, com.mxgraph.util.mxRectangle bounds) -
createLine
-