diElements.remove(bpmnShape);
peService.deletePictogramElement(container);
}
GraphicsAlgorithm ga = choreographyContainer.getGraphicsAlgorithm();
IDimension size = gaService.calculateSize(ga);
List<ContainerShape> newContainers = new ArrayList<ContainerShape>();
int y = 0;
boolean first = true;
List<InteractionNode> sources = new ArrayList<InteractionNode>();
if (choreography instanceof ChoreographyTask) {
for (MessageFlow message : ((ChoreographyTask) choreography).getMessageFlowRef()) {
sources.add(message.getSourceRef());
}
}
Iterator<Participant> iterator = newParticipants.iterator();
while (iterator.hasNext()) {
Participant participant = iterator.next();
ContainerShape bandShape = peService.createContainerShape(choreographyContainer, true);
ParticipantBandKind bandKind = getNewParticipantBandKind(choreography, participant, first,
!iterator.hasNext());
boolean multiple = participant.getParticipantMultiplicity() != null
&& participant.getParticipantMultiplicity().getMaximum() > 1;
int w = size.getWidth();
int h = multiple ? 40 : 20;
BPMNShape bpmnShape = DIUtils.createDIShape(bandShape, participant, 0, y + h, w, h, fp, diagram);
bpmnShape.setChoreographyActivityShape(BusinessObjectUtil.getFirstElementOfType(choreographyContainer,
BPMNShape.class));
bpmnShape.setIsMarkerVisible(multiple);
bpmnShape.setParticipantBandKind(bandKind);
bpmnShape.setIsMessageVisible(sources.contains(participant));
createParticipantBandContainerShape(bandKind, choreographyContainer, bandShape, bpmnShape, showNames);
if (multiple) {
drawMultiplicityMarkers(bandShape);
}
newContainers.add(bandShape);
y += h;
first = false;
}
Tuple<List<ContainerShape>, List<ContainerShape>> topAndBottom = getTopAndBottomBands(newContainers);
resizePartipantBandContainerShapes(size.getWidth(), size.getHeight(), topAndBottom.getFirst(),
topAndBottom.getSecond(), diagram);
}