Prev | Next |
Add Shape Scripts
UML elements and connectors each have a standard appearance, in terms of shape, color and labeling. It is possible to change the appearance of a type of element or connector in a number of ways, using a Shape Script to define the exact feature you want to impose on the default - or main - shape. If you want to standardize the appearance, to apply to many elements, you attach the Shape Script to an attribute of a Stereotype element in a UML Profile (such as an MDG Technology UML Profile).
Access
For the element that defines the stereotype within your UML Profile, define an attribute named '_image' that will specify the Shape Script.
Display the Shape Script editor by clicking the browse icon in the 'Initial Value' field of the '_image' attribute.
Ribbon |
Design > Element > Features > Attributes > [define or select the attribute '_image'] > click on browse icon in the 'Initial Value' field. |
Context Menu |
Right-click on Stereotype element | Features & Properties | Attributes | <define or select the attribute '_image'> | click on in the 'Initial Value' field |
Keyboard Shortcuts |
| <define or select the attribute '_image'>] | click on in the 'Initial Value' field |
Add a Shape Script to a Stereotype element
The Stereotype element now resembles this example:
Step |
Description |
See also |
---|---|---|
1 |
In the 'Name' field, type '_image'. |
|
2 |
Click on the button next to the 'Initial Value' field. The 'Shape Editor' dialog displays. |
Shape Editor |
3 |
Enter the Shape Script in the 'Shape Editor' dialog. When you have finished writing the Shape Script, click on the and then the . |
Write Scripts |
Notes
Such logic is not necessary in the:
- shape source or shape target, which are ignored by Classes, or the
- decoration shapes, which are ignored by Associations
Learn more