BaseElement bpmnElement = shape.getBpmnElement();
if (shape.getChoreographyActivityShape() != null) {
// FIXME: we currently generate participant bands automatically
return;
}
IAddFeature addFeature = featureProvider.getAddFeature(new AddContext(new AreaContext(), bpmnElement));
if (addFeature == null) {
Activator.logStatus(new Status(IStatus.WARNING, Activator.PLUGIN_ID, "Element not supported: "
+ bpmnElement.eClass().getName()));
return;
}
AddContext context = new AddContext();
context.putProperty(IMPORT_PROPERTY, true);
context.setNewObject(bpmnElement);
context.setSize((int) shape.getBounds().getWidth(), (int) shape.getBounds().getHeight());
if (bpmnElement instanceof Lane) {
handleLane(bpmnElement, context, shape);
} else if (bpmnElement instanceof FlowNode) {
handleFlowNode((FlowNode) bpmnElement, context, shape);
} else {
context.setTargetContainer(diagram);
context.setLocation((int) shape.getBounds().getX(), (int) shape.getBounds().getY());
}
if (addFeature.canAdd(context)) {
PictogramElement newContainer = addFeature.add(context);
featureProvider.link(newContainer, new Object[] { bpmnElement, shape });