// retrieve name from business model
String businessName = null;
PictogramElement pictogramElement = context.getPictogramElement();
Object bo = getBusinessObjectForPictogramElement(pictogramElement);
if (bo instanceof AbstractNode) {
AbstractNode eClass = (AbstractNode) bo;
businessName = DiagramUtils.filterFigureLabel(eClass.getDisplayText());
}
// Set name in pictogram model
if (pictogramElement instanceof ContainerShape) {
ContainerShape cs = (ContainerShape) pictogramElement;
boolean finished_label = false;
boolean finished_icon = false;
// now also adapt the text label of the figure
for (Shape shape : cs.getChildren()) {
// special handling for the text shape as its the figures label
if (shape.getGraphicsAlgorithm() instanceof Text) {
Text text = (Text) shape.getGraphicsAlgorithm();
// set the new figure label
text.setValue(businessName);
finished_label = true;
} else if (shape.getGraphicsAlgorithm() instanceof Image) {
// update the icon image
AbstractNode addedClass = (AbstractNode)bo;
// set the new icon id - refresh will to the rest
String iconKey = ImageProvider.getKeyForLargeIcon(addedClass.getIconName());
((Image)shape.getGraphicsAlgorithm()).setId(iconKey);
finished_icon = true;
}
if (finished_icon && finished_label) {