public class BPMNLayout
extends com.mxgraph.layout.mxGraphLayout
Modifier and Type | Class and Description |
---|---|
protected static class |
BPMNLayout.Polygon |
protected static class |
BPMNLayout.Polyline |
protected static class |
BPMNLayout.TreeNode |
Modifier and Type | Field and Description |
---|---|
protected BpmnAutoLayout |
bpmnAutoLayout |
protected boolean |
horizontal
Specifies the orientation of the layout.
|
protected boolean |
invert
Specifies if edge directions should be inverted.
|
protected int |
levelDistance
Holds the levelDistance.
|
protected boolean |
moveTree
Specifies if the tree should be moved to the top, left corner if it is inside a top-level layer.
|
protected int |
nodeDistance
Holds the nodeDistance.
|
protected boolean |
resetEdges
Specifies if all edge points of traversed edges should be removed.
|
protected boolean |
resizeParent
If the parent should be resized to match the width/height of the tree.
|
Constructor and Description |
---|
BPMNLayout(com.mxgraph.view.mxGraph graph) |
BPMNLayout(com.mxgraph.view.mxGraph graph,
boolean horizontal) |
BPMNLayout(com.mxgraph.view.mxGraph graph,
boolean horizontal,
boolean invert) |
Modifier and Type | Method and Description |
---|---|
protected com.mxgraph.util.mxRectangle |
apply(BPMNLayout.TreeNode node,
com.mxgraph.util.mxRectangle bounds) |
protected void |
attachParent(BPMNLayout.TreeNode node,
double height) |
protected BPMNLayout.Polyline |
bridge(BPMNLayout.Polyline line1,
double x1,
double y1,
BPMNLayout.Polyline line2,
double x2,
double y2) |
protected BPMNLayout.Polyline |
createLine(double dx,
double dy,
BPMNLayout.Polyline next) |
protected BPMNLayout.TreeNode |
createNode(Object cell) |
protected BPMNLayout.TreeNode |
dfs(Object cell,
Object parent,
Set<Object> visited)
Does a depth first search starting at the specified cell.
|
void |
execute(Object parent) |
com.mxgraph.view.mxGraph |
getGraph() |
int |
getLevelDistance() |
int |
getNodeDistance() |
protected com.mxgraph.util.mxRectangle |
horizontalLayout(BPMNLayout.TreeNode node,
double x0,
double y0,
com.mxgraph.util.mxRectangle bounds) |
protected boolean |
isBoundaryEvent(Object obj) |
boolean |
isHorizontal() |
boolean |
isInvert() |
boolean |
isMoveTree() |
boolean |
isResetEdges() |
boolean |
isResizeParent() |
boolean |
isVertexIgnored(Object vertex)
Returns a boolean indicating if the given
|
protected double |
join(BPMNLayout.TreeNode node) |
protected void |
layout(BPMNLayout.TreeNode node)
Starts the actual compact tree layout algorithm at the given node.
|
protected void |
layoutLeaf(BPMNLayout.TreeNode node) |
protected double |
merge(BPMNLayout.Polygon p1,
BPMNLayout.Polygon p2) |
protected void |
moveNode(BPMNLayout.TreeNode node,
double dx,
double dy)
Moves the specified node and all of its children by the given amount.
|
protected double |
offset(double p1,
double p2,
double a1,
double a2,
double b1,
double b2) |
void |
setBpmnAutoLayout(BpmnAutoLayout bpmnAutoLayout) |
void |
setHorizontal(boolean horizontal) |
void |
setInvert(boolean invert) |
void |
setLevelDistance(int levelDistance) |
void |
setMoveTree(boolean moveTree) |
void |
setNodeDistance(int nodeDistance) |
void |
setResetEdges(boolean resetEdges) |
void |
setResizeParent(boolean resizeParent) |
protected com.mxgraph.util.mxRectangle |
verticalLayout(BPMNLayout.TreeNode node,
Object parent,
double x0,
double y0,
com.mxgraph.util.mxRectangle bounds) |
protected BpmnAutoLayout bpmnAutoLayout
protected boolean horizontal
protected boolean invert
protected boolean resizeParent
protected boolean moveTree
protected boolean resetEdges
protected int levelDistance
protected int nodeDistance
public BPMNLayout(com.mxgraph.view.mxGraph graph)
graph
- public BPMNLayout(com.mxgraph.view.mxGraph graph, boolean horizontal)
graph
- horizontal
- public BPMNLayout(com.mxgraph.view.mxGraph graph, boolean horizontal, boolean invert)
graph
- horizontal
- invert
- public void setBpmnAutoLayout(BpmnAutoLayout bpmnAutoLayout)
public com.mxgraph.view.mxGraph getGraph()
getGraph
in class com.mxgraph.layout.mxGraphLayout
public boolean isVertexIgnored(Object vertex)
isVertexIgnored
in class com.mxgraph.layout.mxGraphLayout
vertex
- Object that represents the vertex to be tested.public boolean isHorizontal()
public void setHorizontal(boolean horizontal)
horizontal
- the horizontal to setpublic boolean isInvert()
public void setInvert(boolean invert)
invert
- the invert to setpublic boolean isResizeParent()
public void setResizeParent(boolean resizeParent)
resizeParent
- the resizeParent to setpublic boolean isMoveTree()
public void setMoveTree(boolean moveTree)
moveTree
- the moveTree to setpublic boolean isResetEdges()
public void setResetEdges(boolean resetEdges)
resetEdges
- the resetEdges to setpublic int getLevelDistance()
public void setLevelDistance(int levelDistance)
levelDistance
- the levelDistance to setpublic int getNodeDistance()
public void setNodeDistance(int nodeDistance)
nodeDistance
- the nodeDistance to setpublic void execute(Object parent)
execute
in interface com.mxgraph.layout.mxIGraphLayout
execute
in class com.mxgraph.layout.mxGraphLayout
protected boolean isBoundaryEvent(Object obj)
protected void moveNode(BPMNLayout.TreeNode node, double dx, double dy)
protected BPMNLayout.TreeNode dfs(Object cell, Object parent, Set<Object> visited)
protected void layout(BPMNLayout.TreeNode node)
protected com.mxgraph.util.mxRectangle horizontalLayout(BPMNLayout.TreeNode node, double x0, double y0, com.mxgraph.util.mxRectangle bounds)
protected com.mxgraph.util.mxRectangle verticalLayout(BPMNLayout.TreeNode node, Object parent, double x0, double y0, com.mxgraph.util.mxRectangle bounds)
protected void attachParent(BPMNLayout.TreeNode node, double height)
protected void layoutLeaf(BPMNLayout.TreeNode node)
protected double join(BPMNLayout.TreeNode node)
protected double merge(BPMNLayout.Polygon p1, BPMNLayout.Polygon p2)
protected double offset(double p1, double p2, double a1, double a2, double b1, double b2)
protected BPMNLayout.Polyline bridge(BPMNLayout.Polyline line1, double x1, double y1, BPMNLayout.Polyline line2, double x2, double y2)
protected BPMNLayout.TreeNode createNode(Object cell)
protected com.mxgraph.util.mxRectangle apply(BPMNLayout.TreeNode node, com.mxgraph.util.mxRectangle bounds)
protected BPMNLayout.Polyline createLine(double dx, double dy, BPMNLayout.Polyline next)
Copyright © 2016 Alfresco. All rights reserved.