return context.getTargetContainer().equals(getDiagram());
}
@Override
public PictogramElement add(IAddContext context) {
ChoreographyActivity choreography = (ChoreographyActivity) context.getNewObject();
int width = context.getWidth() > 0 ? context.getWidth() : 150;
int height = context.getHeight() > 0 ? context.getHeight() : 150;
ContainerShape choreographyContainer = peService.createContainerShape(context.getTargetContainer(), true);
RoundedRectangle containerRect = gaService.createRoundedRectangle(choreographyContainer, R, R);
gaService.setLocationAndSize(containerRect, context.getX(), context.getY(), width, height);
StyleUtil.applyBGStyle(containerRect, this);
decorateContainerRect(containerRect);
Object importProperty = context.getProperty(DIImport.IMPORT_PROPERTY);
if (importProperty != null && (Boolean) importProperty) {
addedFromImport(choreography, choreographyContainer, context);
}
Shape nameShape = peService.createShape(choreographyContainer, false);
Text text = gaService.createDefaultText(getDiagram(), nameShape);
text.setValue(choreography.getName());
text.setStyle(StyleUtil.getStyleForText(getDiagram()));
text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
text.setVerticalAlignment(Orientation.ALIGNMENT_TOP);
text.getFont().setBold(false);
setTextLocation(choreographyContainer, text, width, height);