use of org.eclipse.bpmn2.di.BPMNPlane in project kie-wb-common by kiegroup.
the class Bpmn2JsonUnmarshaller method updateShapeBoundsInSubprocess.
public void updateShapeBoundsInSubprocess(BPMNPlane plane, BaseElement ele, SubProcess sub, float parentX, float parentY) {
boolean foundInSubprocess = false;
for (FlowElement subEle : sub.getFlowElements()) {
if (subEle.getId().equals(ele.getId())) {
foundInSubprocess = true;
Bounds subEleBounds = getBoundsForElement(subEle, plane);
if (subEleBounds != null) {
subEleBounds.setX(subEleBounds.getX() + parentX);
subEleBounds.setY(subEleBounds.getY() + parentY);
}
}
}
if (!foundInSubprocess) {
for (FlowElement subEle : sub.getFlowElements()) {
if (subEle instanceof SubProcess) {
Bounds subEleBounds = getBoundsForElement(subEle, plane);
updateShapeBoundsInSubprocess(plane, ele, (SubProcess) subEle, subEleBounds.getX(), subEleBounds.getY());
}
}
}
}
use of org.eclipse.bpmn2.di.BPMNPlane in project kie-wb-common by kiegroup.
the class Bpmn2JsonUnmarshaller method createSubProcessDiagram.
private void createSubProcessDiagram(BPMNPlane plane, FlowElement flowElement, BpmnDiFactory factory) {
SubProcess sp = (SubProcess) flowElement;
for (FlowElement subProcessFlowElement : sp.getFlowElements()) {
if (subProcessFlowElement instanceof SubProcess) {
createBpmnShapeForElement(factory, plane, subProcessFlowElement);
createSubProcessDiagram(plane, subProcessFlowElement, factory);
} else if (subProcessFlowElement instanceof FlowNode) {
createBpmnShapeForElement(factory, plane, subProcessFlowElement);
if (subProcessFlowElement instanceof BoundaryEvent) {
createDockersForBoundaryEvent((BoundaryEvent) subProcessFlowElement);
}
} else if (subProcessFlowElement instanceof SequenceFlow) {
createBpmnEdgeForSequenceFlow(factory, plane, (SequenceFlow) subProcessFlowElement);
}
}
if (sp.getArtifacts() != null) {
List<Association> incompleteAssociations = new ArrayList<Association>();
for (Artifact artifact : sp.getArtifacts()) {
// if (artifact instanceof TextAnnotation || artifact instanceof Group) {
if (artifact instanceof Group) {
createBpmnShapeForElement(factory, plane, artifact);
}
if (artifact instanceof Association) {
Association association = (Association) artifact;
if (association.getSourceRef() != null && association.getTargetRef() != null) {
createBpmnEdgeForAssociation(factory, plane, association);
} else {
incompleteAssociations.add(association);
}
}
}
if (!incompleteAssociations.isEmpty()) {
for (Association incompleteAssociation : incompleteAssociations) {
sp.getArtifacts().remove(incompleteAssociation);
}
}
}
}
use of org.eclipse.bpmn2.di.BPMNPlane in project kie-wb-common by kiegroup.
the class Bpmn2JsonUnmarshaller method updateShapeBoundsInSubprocessInLanes.
public void updateShapeBoundsInSubprocessInLanes(BPMNPlane plane, BaseElement ele, SubProcess sub, float parentX, float parentY) {
for (FlowElement subEle : sub.getFlowElements()) {
Bounds subEleBounds = getBoundsForElement(subEle, plane);
if (subEleBounds != null) {
subEleBounds.setX(subEleBounds.getX() + parentX);
subEleBounds.setY(subEleBounds.getY() + parentY);
}
if (subEle instanceof SubProcess) {
updateShapeBoundsInSubprocessInLanes(plane, ele, (SubProcess) subEle, subEleBounds.getX(), subEleBounds.getY());
}
}
}
use of org.eclipse.bpmn2.di.BPMNPlane in project kie-wb-common by kiegroup.
the class Bpmn2JsonUnmarshaller method revisitEdgeBoundsInLanes.
public void revisitEdgeBoundsInLanes(Definitions def) {
BPMNPlane plane = def.getDiagrams().get(0).getPlane();
List<DiagramElement> diagramElements = plane.getPlaneElement();
for (DiagramElement dia : diagramElements) {
if (dia instanceof BPMNEdge) {
BPMNEdge edge = (BPMNEdge) dia;
updateEdgeBoundsInLanes(def, plane, edge, edge.getBpmnElement());
}
}
}
use of org.eclipse.bpmn2.di.BPMNPlane in project kie-wb-common by kiegroup.
the class Bpmn2JsonUnmarshaller method createBpmnShapeForElement.
private void createBpmnShapeForElement(BpmnDiFactory factory, BPMNPlane plane, BaseElement element) {
Bounds bounds = _bounds.get(element.getId());
if (bounds != null) {
BPMNShape shape = factory.createBPMNShape();
shape.setBpmnElement(element);
shape.setBounds(bounds);
plane.getPlaneElement().add(shape);
}
}
Aggregations