List<GraphicInfo> flowGraphicsList = createFlowGraphicInfoList(sourceShape, targetShape, freeFormConnection);
model.getBpmnModel().addFlowGraphicInfoList(association.getId(), flowGraphicsList);
}
protected List<GraphicInfo> createFlowGraphicInfoList(Shape sourceElement, Shape targetElement, FreeFormConnection freeFormConnection) {
ILocation sourceLocation = Graphiti.getLayoutService().getLocationRelativeToDiagram(sourceElement);
int sourceX = sourceLocation.getX();
int sourceY = sourceLocation.getY();
int sourceWidth = sourceElement.getGraphicsAlgorithm().getWidth();
int sourceHeight = sourceElement.getGraphicsAlgorithm().getHeight();
int sourceMiddleX = sourceX + (sourceWidth / 2);
int sourceMiddleY = sourceY + (sourceHeight / 2);
int sourceBottomY = sourceY + sourceHeight;
ILocation targetLocation = Graphiti.getLayoutService().getLocationRelativeToDiagram(targetElement);
int targetX = targetLocation.getX();
int targetY = targetLocation.getY();
int targetWidth = targetElement.getGraphicsAlgorithm().getWidth();
int targetHeight = targetElement.getGraphicsAlgorithm().getHeight();
int targetMiddleX = targetX + (targetWidth / 2);
int targetMiddleY = targetY + (targetHeight / 2);
int targetBottomY = targetY + targetHeight;