Add Shape Scripts
To add a Shape Script to a stereotype in a UML Profile, follow the steps below:
- On the Profile Package child diagram, select a Stereotype element.
- Right-click on the element and select the Attributes context menu option.
- In the Attributes Properties dialog, in the Name field, type _image.
- Click on the [ ... ] button next to the Initial field. The Shape Editor dialog displays.
- Enter the Shape Script in the Shape Editor dialog, and click on the OK and Close buttons.
The Stereotype element now resembles the example below:
If you are creating a Shape Script for an Association Class, be aware that the Shape Script is applied to both the Class part and the Association part. Therefore, you might have to include logic in the shape main that tests the type of the element so that you can give separate drawing instructions for Class and for Association. Such logic is not necessary in the: