Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

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 Profile Stereotype element: F9 > General

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 OK button and then the Close button.

Write Scripts

Notes

  • Your Shape Script might include externally-defined images; in this case the Shape Script would include the image method, specifying the image file name prefixed with the technology name
  • If you are creating a Shape Script for an Association Class, note 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:
         -  shape source or shape target, which are ignored by Classes, or the
         -  decoration shapes, which are ignored by Associations
  • You can also apply Shape Scripts to elements on an ad hoc basis, attaching the Shape Script to a stereotype defined on the 'UML Types' dialog ('Settings > UML Types')

Learn more

Learning Center topics

  • Alt+F1 | Enterprise Architect | Modeling Languages | Build a Profile | Defining an Image