if (!hasTopMessage && shouldDrawTopMessage) {
int y = (int) (bounds.getY() - ENVELOPE_HEIGHT_MODIFIER - ENV_H);
drawMessageLink(topMessageName, topBoundaryAnchor, x, y, isFilled(topAndBottom.getFirst()));
} else if (hasTopMessage && !shouldDrawTopMessage) {
PictogramElement envelope = (PictogramElement) topConnections.get(topConnectionIndex).getEnd().eContainer();
peService.deletePictogramElement(topConnections.get(topConnectionIndex));
peService.deletePictogramElement(envelope);
} else if (hasTopMessage && shouldDrawTopMessage) {
PictogramElement envelope = (PictogramElement) topConnections.get(topConnectionIndex).getEnd().eContainer();
setMessageLabel(topMessageName, envelope);
}
if (!hasBottomMessage && shouldDrawBottomMessage) {
int y = (int) (bounds.getY() + bounds.getHeight() + ENVELOPE_HEIGHT_MODIFIER);
drawMessageLink(bottomMessageName, bottomBoundaryAnchor, x, y, isFilled(topAndBottom.getSecond()));
} else if (hasBottomMessage && !shouldDrawBottomMessage) {
PictogramElement envelope = (PictogramElement) bottomConnections.get(bottomConnectionIndex).getEnd()
.eContainer();
peService.deletePictogramElement(bottomConnections.get(bottomConnectionIndex));
peService.deletePictogramElement(envelope);
} else if (hasBottomMessage && shouldDrawBottomMessage) {
PictogramElement envelope = (PictogramElement) bottomConnections.get(bottomConnectionIndex).getEnd()
.eContainer();
setMessageLabel(bottomMessageName, envelope);
}
return;