Download Enterprise Architect User Guide

Transcript
101
Work With Elements | Element Tasks
You should create the Templates package in an administrative View of the project file, rather than in any work
area. This prevents the package from being changed or lost in any project development work.
There are two other ways in which you can modify the appearance of elements in diagrams:
· You can define the default appearance of elements (and other structures) grouped in a diagram by using
UML Profiles (see Extending UML in Enterprise Architect). These provide a means of extending the UML
Language, which enables you to build UML models in particular domains. They are based on additional
stereotypes and Tagged Values that are applied to elements, attributes, methods, connectors, connector
ends and so on.
· You can modify the appearance of elements (and connectors) of a specific type using stereotypes (see
Extending UML in Enterprise Architect). Stereotypes take precedence over templates; if you drop an
unstereotyped element - a Class, for example - onto a diagram, Enterprise Architect searches the
Templates package for a Class diagram that defines an unstereotyped Class, and applies that definition to
the new Class. If you drop a stereotyped Class onto a diagram, the stereotype defines the Class
appearance so the template is not accessed. Stereotypes are much more flexible for defining the
appearance of an element under different scenarios.
Procedure
To set up the element Templates package, follow the steps below:
1. Create a new package in the appropriate administration View. You can give this package any name;
Templates is an unambiguous option.
2. Within the Templates package create new diagrams, one for each type of diagram to template. Give
them easily recognized names; for example ClassTemplate for the template for Class diagrams.
3. Add new elements to the template diagrams from the Enterprise Architect UML Toolbox and configure
the size, appearance, notes, version and other properties.
4. Select the Settings | Template Package menu option to set the templates as the default element
templates. The Browse Project window displays.
5. Locate and click on the Templates package, and click on the OK button to set the package as the
default element template.
Now each new element you add to your project is created with the settings from the appropriate Template
diagram.
Note:
If you decide not to use the default element template, set the default element template to <none> in the
Browse Project window. The <none> package is at the bottom of the hierarchy shown in the Browse Project
window.
3.2.19 Highlight Context Element
You can show a hatched border around a selected element by selecting the Always Highlight Context
Element checkbox on the Diagram Behavior page of the Options dialog (select the Tools | Options |
Diagram | Behavior menu option). If you have selected this checkbox, the selected element displays similarly
to the following example:
UML Modeling with Enterprise Architect - UML Modeling Tool