Package org.activiti.bpmn
Class BpmnAutoLayout
- java.lang.Object
-
- org.activiti.bpmn.BpmnAutoLayout
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Association>associationsprotected List<BoundaryEvent>boundaryEventsprotected BpmnModelbpmnModelprotected ObjectcellParentprotected inteventSizeprotected intgatewaySizeprotected Map<String,Object>generatedAssociationEdgesprotected Map<String,Object>generatedSequenceFlowEdgesprotected Map<String,Object>generatedVerticesprotected com.mxgraph.view.mxGraphgraphprotected Map<String,Artifact>handledArtifactsprotected Map<String,FlowElement>handledFlowElementsprotected Map<String,SequenceFlow>sequenceFlowsprotected intsubProcessMarginprotected inttaskHeightprotected inttaskWidthprotected Map<String,TextAnnotation>textAnnotations
-
Constructor Summary
Constructors Constructor Description BpmnAutoLayout(BpmnModel bpmnModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateDiagramInterchangeInformation(BaseElement element, List<com.mxgraph.util.mxPoint> waypoints)protected GraphicInfocreateDiagramInterchangeInformation(FlowElement flowElement, int x, int y, int width, int height)protected voidcreateEventVertex(FlowElement flowElement)protected voidcreateGatewayVertex(FlowElement flowElement)protected voidensureArtifactIdSet(Artifact artifact)protected voidensureSequenceFlowIdSet(SequenceFlow sequenceFlow)protected doubleeuclidianDistance(com.mxgraph.util.mxPoint point1, com.mxgraph.util.mxPoint point2)voidexecute()protected voidgenerateActivityDiagramInterchangeElements()protected voidgenerateAssociationDiagramInterchangeElements()protected voidgenerateDiagramInterchangeElements()protected voidgenerateSequenceFlowDiagramInterchangeElements()intgetEventSize()intgetGatewaySize()com.mxgraph.view.mxGraphgetGraph()intgetSubProcessMargin()intgetTaskHeight()intgetTaskWidth()protected voidhandleActivity(FlowElement flowElement)protected voidhandleAssociation(Association association)protected voidhandleAssociations()protected voidhandleBoundaryEvents()protected voidhandleEvent(FlowElement flowElement)protected voidhandleSequenceFlow()protected voidhandleSequenceFlow(SequenceFlow sequenceFlow)protected voidhandleSubProcess(FlowElement flowElement)protected voidlayout(FlowElementsContainer flowElementsContainer)protected List<com.mxgraph.util.mxPoint>optimizeEdgePoints(List<com.mxgraph.util.mxPoint> unoptimizedPointsList)voidsetEventSize(int eventSize)voidsetGatewaySize(int gatewaySize)voidsetGraph(com.mxgraph.view.mxGraph graph)voidsetSubProcessMargin(int subProcessMargin)voidsetTaskHeight(int taskHeight)voidsetTaskWidth(int taskWidth)protected voidtranslateNestedSubprocessElements(SubProcess subProcess)protected voidtranslateNestedSubprocesses(Process process)Since subprocesses are autolayouted independently (seehandleSubProcess(FlowElement)), the elements have x and y coordinates relative to the bounds of the subprocess (thinking the subprocess is on (0,0).
-
-
-
Field Detail
-
bpmnModel
protected BpmnModel bpmnModel
-
eventSize
protected int eventSize
-
gatewaySize
protected int gatewaySize
-
taskWidth
protected int taskWidth
-
taskHeight
protected int taskHeight
-
subProcessMargin
protected int subProcessMargin
-
graph
protected com.mxgraph.view.mxGraph graph
-
cellParent
protected Object cellParent
-
associations
protected Map<String,Association> associations
-
textAnnotations
protected Map<String,TextAnnotation> textAnnotations
-
sequenceFlows
protected Map<String,SequenceFlow> sequenceFlows
-
boundaryEvents
protected List<BoundaryEvent> boundaryEvents
-
handledFlowElements
protected Map<String,FlowElement> handledFlowElements
-
-
Constructor Detail
-
BpmnAutoLayout
public BpmnAutoLayout(BpmnModel bpmnModel)
-
-
Method Detail
-
execute
public void execute()
-
layout
protected void layout(FlowElementsContainer flowElementsContainer)
-
ensureSequenceFlowIdSet
protected void ensureSequenceFlowIdSet(SequenceFlow sequenceFlow)
-
ensureArtifactIdSet
protected void ensureArtifactIdSet(Artifact artifact)
-
handleAssociation
protected void handleAssociation(Association association)
-
handleSequenceFlow
protected void handleSequenceFlow(SequenceFlow sequenceFlow)
-
handleEvent
protected void handleEvent(FlowElement flowElement)
-
handleActivity
protected void handleActivity(FlowElement flowElement)
-
handleSubProcess
protected void handleSubProcess(FlowElement flowElement)
-
handleBoundaryEvents
protected void handleBoundaryEvents()
-
handleSequenceFlow
protected void handleSequenceFlow()
-
handleAssociations
protected void handleAssociations()
-
createEventVertex
protected void createEventVertex(FlowElement flowElement)
-
createGatewayVertex
protected void createGatewayVertex(FlowElement flowElement)
-
generateDiagramInterchangeElements
protected void generateDiagramInterchangeElements()
-
generateActivityDiagramInterchangeElements
protected void generateActivityDiagramInterchangeElements()
-
generateSequenceFlowDiagramInterchangeElements
protected void generateSequenceFlowDiagramInterchangeElements()
-
generateAssociationDiagramInterchangeElements
protected void generateAssociationDiagramInterchangeElements()
-
euclidianDistance
protected double euclidianDistance(com.mxgraph.util.mxPoint point1, com.mxgraph.util.mxPoint point2)
-
optimizeEdgePoints
protected List<com.mxgraph.util.mxPoint> optimizeEdgePoints(List<com.mxgraph.util.mxPoint> unoptimizedPointsList)
-
createDiagramInterchangeInformation
protected GraphicInfo createDiagramInterchangeInformation(FlowElement flowElement, int x, int y, int width, int height)
-
createDiagramInterchangeInformation
protected void createDiagramInterchangeInformation(BaseElement element, List<com.mxgraph.util.mxPoint> waypoints)
-
translateNestedSubprocesses
protected void translateNestedSubprocesses(Process process)
Since subprocesses are autolayouted independently (seehandleSubProcess(FlowElement)), the elements have x and y coordinates relative to the bounds of the subprocess (thinking the subprocess is on (0,0). This however, does not work for nested subprocesses, as they need to take in account the x and y coordinates for each of the parent subproceses. This method is to be called after fully layouting one process, since ALL elements need to have x and y.
-
translateNestedSubprocessElements
protected void translateNestedSubprocessElements(SubProcess subProcess)
-
getGraph
public com.mxgraph.view.mxGraph getGraph()
-
setGraph
public void setGraph(com.mxgraph.view.mxGraph graph)
-
getEventSize
public int getEventSize()
-
setEventSize
public void setEventSize(int eventSize)
-
getGatewaySize
public int getGatewaySize()
-
setGatewaySize
public void setGatewaySize(int gatewaySize)
-
getTaskWidth
public int getTaskWidth()
-
setTaskWidth
public void setTaskWidth(int taskWidth)
-
getTaskHeight
public int getTaskHeight()
-
setTaskHeight
public void setTaskHeight(int taskHeight)
-
getSubProcessMargin
public int getSubProcessMargin()
-
setSubProcessMargin
public void setSubProcessMargin(int subProcessMargin)
-
-