use of org.camunda.bpm.model.bpmn.instance.bpmndi.BpmnShape in project camunda-bpmn-model by camunda.
the class AbstractBoundaryEventBuilder method setWaypointsWithSourceAndTarget.
@Override
protected void setWaypointsWithSourceAndTarget(BpmnEdge edge, FlowNode edgeSource, FlowNode edgeTarget) {
BpmnShape source = findBpmnShape(edgeSource);
BpmnShape target = findBpmnShape(edgeTarget);
if (source != null && target != null) {
Bounds sourceBounds = source.getBounds();
Bounds targetBounds = target.getBounds();
double sourceX = sourceBounds.getX();
double sourceY = sourceBounds.getY();
double sourceWidth = sourceBounds.getWidth();
double sourceHeight = sourceBounds.getHeight();
double targetX = targetBounds.getX();
double targetY = targetBounds.getY();
double targetHeight = targetBounds.getHeight();
Waypoint w1 = createInstance(Waypoint.class);
w1.setX(sourceX + sourceWidth / 2);
w1.setY(sourceY + sourceHeight);
Waypoint w2 = createInstance(Waypoint.class);
w2.setX(sourceX + sourceWidth / 2);
w2.setY(sourceY + sourceHeight + SPACE);
Waypoint w3 = createInstance(Waypoint.class);
w3.setX(targetX);
w3.setY(targetY + targetHeight / 2);
edge.addChildElement(w1);
edge.addChildElement(w2);
edge.addChildElement(w3);
}
}
Aggregations