Package org.activiti.bpmn
Class BpmnAutoLayout
- java.lang.Object
-
- org.activiti.bpmn.BpmnAutoLayout
-
public class BpmnAutoLayout extends java.lang.ObjectAuto layouts aBpmnModel.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,org.activiti.bpmn.model.Association>associationsprotected java.util.List<org.activiti.bpmn.model.BoundaryEvent>boundaryEventsprotected org.activiti.bpmn.model.BpmnModelbpmnModelprotected java.lang.ObjectcellParentprotected inteventSizeprotected intgatewaySizeprotected java.util.Map<java.lang.String,java.lang.Object>generatedAssociationEdgesprotected java.util.Map<java.lang.String,java.lang.Object>generatedSequenceFlowEdgesprotected java.util.Map<java.lang.String,java.lang.Object>generatedVerticesprotected com.mxgraph.view.mxGraphgraphprotected java.util.Map<java.lang.String,org.activiti.bpmn.model.Artifact>handledArtifactsprotected java.util.Map<java.lang.String,org.activiti.bpmn.model.FlowElement>handledFlowElementsprotected java.util.Map<java.lang.String,org.activiti.bpmn.model.SequenceFlow>sequenceFlowsprotected intsubProcessMarginprotected inttaskHeightprotected inttaskWidthprotected java.util.Map<java.lang.String,org.activiti.bpmn.model.TextAnnotation>textAnnotations
-
Constructor Summary
Constructors Constructor Description BpmnAutoLayout(org.activiti.bpmn.model.BpmnModel bpmnModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateDiagramInterchangeInformation(org.activiti.bpmn.model.BaseElement element, java.util.List<com.mxgraph.util.mxPoint> waypoints)protected org.activiti.bpmn.model.GraphicInfocreateDiagramInterchangeInformation(org.activiti.bpmn.model.FlowElement flowElement, int x, int y, int width, int height)protected voidcreateEventVertex(org.activiti.bpmn.model.FlowElement flowElement)protected voidcreateGatewayVertex(org.activiti.bpmn.model.FlowElement flowElement)protected voidensureArtifactIdSet(org.activiti.bpmn.model.Artifact artifact)protected voidensureSequenceFlowIdSet(org.activiti.bpmn.model.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(org.activiti.bpmn.model.FlowElement flowElement)protected voidhandleAssociation(org.activiti.bpmn.model.Association association)protected voidhandleAssociations()protected voidhandleBoundaryEvents()protected voidhandleEvent(org.activiti.bpmn.model.FlowElement flowElement)protected voidhandleSequenceFlow()protected voidhandleSequenceFlow(org.activiti.bpmn.model.SequenceFlow sequenceFlow)protected voidhandleSubProcess(org.activiti.bpmn.model.FlowElement flowElement)protected voidlayout(org.activiti.bpmn.model.FlowElementsContainer flowElementsContainer)protected java.util.List<com.mxgraph.util.mxPoint>optimizeEdgePoints(java.util.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(org.activiti.bpmn.model.SubProcess subProcess)protected voidtranslateNestedSubprocesses(org.activiti.bpmn.model.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 org.activiti.bpmn.model.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 java.lang.Object cellParent
-
associations
protected java.util.Map<java.lang.String,org.activiti.bpmn.model.Association> associations
-
textAnnotations
protected java.util.Map<java.lang.String,org.activiti.bpmn.model.TextAnnotation> textAnnotations
-
sequenceFlows
protected java.util.Map<java.lang.String,org.activiti.bpmn.model.SequenceFlow> sequenceFlows
-
boundaryEvents
protected java.util.List<org.activiti.bpmn.model.BoundaryEvent> boundaryEvents
-
handledFlowElements
protected java.util.Map<java.lang.String,org.activiti.bpmn.model.FlowElement> handledFlowElements
-
handledArtifacts
protected java.util.Map<java.lang.String,org.activiti.bpmn.model.Artifact> handledArtifacts
-
generatedVertices
protected java.util.Map<java.lang.String,java.lang.Object> generatedVertices
-
generatedSequenceFlowEdges
protected java.util.Map<java.lang.String,java.lang.Object> generatedSequenceFlowEdges
-
generatedAssociationEdges
protected java.util.Map<java.lang.String,java.lang.Object> generatedAssociationEdges
-
-
Method Detail
-
execute
public void execute()
-
layout
protected void layout(org.activiti.bpmn.model.FlowElementsContainer flowElementsContainer)
-
ensureSequenceFlowIdSet
protected void ensureSequenceFlowIdSet(org.activiti.bpmn.model.SequenceFlow sequenceFlow)
-
ensureArtifactIdSet
protected void ensureArtifactIdSet(org.activiti.bpmn.model.Artifact artifact)
-
handleAssociation
protected void handleAssociation(org.activiti.bpmn.model.Association association)
-
handleSequenceFlow
protected void handleSequenceFlow(org.activiti.bpmn.model.SequenceFlow sequenceFlow)
-
handleEvent
protected void handleEvent(org.activiti.bpmn.model.FlowElement flowElement)
-
handleActivity
protected void handleActivity(org.activiti.bpmn.model.FlowElement flowElement)
-
handleSubProcess
protected void handleSubProcess(org.activiti.bpmn.model.FlowElement flowElement)
-
handleBoundaryEvents
protected void handleBoundaryEvents()
-
handleSequenceFlow
protected void handleSequenceFlow()
-
handleAssociations
protected void handleAssociations()
-
createEventVertex
protected void createEventVertex(org.activiti.bpmn.model.FlowElement flowElement)
-
createGatewayVertex
protected void createGatewayVertex(org.activiti.bpmn.model.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 java.util.List<com.mxgraph.util.mxPoint> optimizeEdgePoints(java.util.List<com.mxgraph.util.mxPoint> unoptimizedPointsList)
-
createDiagramInterchangeInformation
protected org.activiti.bpmn.model.GraphicInfo createDiagramInterchangeInformation(org.activiti.bpmn.model.FlowElement flowElement, int x, int y, int width, int height)
-
createDiagramInterchangeInformation
protected void createDiagramInterchangeInformation(org.activiti.bpmn.model.BaseElement element, java.util.List<com.mxgraph.util.mxPoint> waypoints)
-
translateNestedSubprocesses
protected void translateNestedSubprocesses(org.activiti.bpmn.model.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(org.activiti.bpmn.model.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)
-
-