Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Contents |
Prev | Next |
Getting Started With Shape Scripts
As Shape Scripts are associated with stereotypes, you define them through the 'Stereotypes' tab of the 'UML Types' dialog; each stereotype can have one Shape Script. The process of setting up a Shape Script is quite simple yet very flexible.
Access
Ribbon |
Configure > Reference Data > UML Types > Stereotypes |
Shape Script Process
Step |
Action |
See also |
---|---|---|
1 |
Select the stereotype to which to attach the Shape Script, from the list on the right of the dialog. You select an existing stereotype, but if a suitable one is not available you can create a new stereotype that, once saved, displays in the list and can be selected. |
Custom Stereotypes |
2 |
In the 'Override Appearance' panel, select the 'Shape Script' radio button and then click on the . The Shape Editor displays. |
Shape Script Editor |
3 |
Type or copy the script into the Edit window. To review the shape in the 'Preview' panel, click on the . |
Writing Scripts |
4 |
If you define a composite Shape Script (a main shape with decorations and labels, or separate parts such as a connector with source-end and target-end shapes), click on the to page through the components of the shape, in the 'Preview' panel. |
Example Scripts |
5 |
Once you have finished writing your Shape Script, click on the to return to the 'Stereotypes' tab. Then click on the to save the Shape Script and its assignment to the stereotype. |
|
6 |
Drag and drop the appropriate standard UML element or connector into your diagram. The object will be of the type you selected as the 'Base Class' of the stereotype. Right-click on the object and select the 'Properties' option. On the 'Properties' dialog, click on the 'Stereotype' drop-down arrow, select the stereotype you created and click on the . The object's shape now reflects the Shape Script assigned to the stereotype. |
Custom Stereotypes |
Notes
- Looping constructs
- String Manipulation
- Arithmetical Operations
- Variable declaration