Appendix B - Configuring Stereotypes and Tagged Value
Appendix B - Configuring Stereotypes and Tagged Value
This chapter explains in detail how to apply Stereotypes and Tagged Value to categorize model elements.
Introduction
Stereotypes allow you to categorize different kinds of model elements. It may specify additional constraints and tag definitions for the models, and also be used to indicate a difference in meaning or usage between two model elements with an identical structure. An icon or formatting (fill, line and font) can be specified to a stereotype to present the elements that apply to that stereotype.
We know that everything in UML contains its own properties. Tagged values let you add properties for specifying keyword-value pairs of model elements. You can define tags that apply to a model element or a stereotype.
Adding Stereotype to a Model Element
To add stereotype for a model element:
- Select the desired model element from the diagram.
- Right-click on the selection and choose Stereotypes > Stereotypes...from the popup menu.
- This displays the Stereotypes page of the Class Specification dialog box.
- Select a stereotype listed under the All list.
- Press > to assign the stereotype to the model element.
|
To assign multiple stereotypes to a model element, press on the Ctrl key and select the desired stereotypes and press >> to assign them to the model element. |
- Press OK to apply the setting.
Configuring Stereotypes
Apart from using existing stereotypes, you can create new stereotypes to suit your need. Similarly, you can edit stereotypes to change their properties and appearance in a diagram. To configure stereotypes, you must first display the Configure Stereotypes dialog box. Select from main menu Tools > Configure Stereotypes...to display the dialog box.
| Command |
Description |
| Add |
Allows you to create a new stereotype for a particular model element by displaying the Stereotype Specification dialog box of the new stereotype. Fill in the details of the new stereotype from that dialog box and confirm the changes to create a new stereotype. |
| Edit |
Allows you to edit an existing stereotype by displaying the Stereotype Specification dialog box of the selected stereotype. Fill in the details of the stereotype from that dialog box and confirm the changes to edit the properties of the stereotype.. |
| Remove |
Remove a stereotype available to a particular model element. |
| OK |
Close the dialog box by committing all changes made. |
| Cancel |
Close the dialog box without saving any changes made. |
| Help |
Display the Help content of the Configure Stereotypes dialog box. |
Table B.1
Creating a New Stereotype
To create a new stereotype:
- Displays the Configure Stereotypes dialog box.
- Select the model element for which the new stereotype is to be available to.
- Press on the Add...button. This displays the Stereotype Specification dialog box for specifying the details of the new stereotype.
- Specify the details of the stereotype such as its name, documentation and its icon. (For more details on the use of Stereotype Specification dialog box, please refer to the following section in this chapter)
- Click OK to confirm the changes.
The new stereotype is now available to the selected model element.
Editing a Stereotype
To edit a stereotype:
- Display the Configure Stereotypes dialog box.
- Select a stereotype from the Stereotypes list for editing. The stereotype can be a predefined one or one defined by you.
- Press on the Edit...button. This displays the Stereotype Specification dialog box for specifying the details of the new stereotype.
- Specify the details of the stereotype such as its name, documentation and its icon. (For more details on the use of Stereotype Specification dialog box, please refer to the following section in this chapter)
- Click OK to confirm the changes.
If the stereotype is in use by a model element, the appearance of that stereotype needs to be refreshed by pressing OK from the Configure Stereotypes dialog box in order to commit the changes made.
Using the Stereotype Specification Dialog Box
When creating or editing a stereotype you will come across the Stereotype Specification dialog box.
| Field |
Description |
| Name |
The name of the stereotype. |
| Icon Path |
An image assigned to this stereotype. Click ...to select the path of the image, or click to discard the icon. |
| Fill, Line, Font |
To specify the appearance of the stereotyped shapes. Their usages will be described in detail in the Stereotype Formats section later in this chapter. |
| Documentation |
The description or any information relevant to the stereotype. |
| Abstract |
To specify the stereotype as abstract. |
| Leaf |
To specify the stereotype as leaf. |
| Root |
To specify the stereotype as root. |
| Reset |
Reset all changes made. |
| OK |
Close the dialog box by committing all changes made. |
| Cancel |
Close the dialog box without saving any changes made. |
| Apply |
Committing all changes made. |
| Help |
Display the Help content of Stereotypes Specification dialog box. |
Table B.2
Adding Tagged Value to a Stereotype
To add Tagged Value definitions to a stereotype:
- Select Tools > Configure Stereotypes...from main menu. This displays the Configure Stereotypes dialog box.
- Select the desired stereotype and click Edit...
- The Stereotype Specification dialog box is displayed. Switch to the Tagged Value Definitions tab.
- Click Add. This displays two kind of tags for selection, Text or Model Element. Click on the desired one.
Adding Text Tag to stereotypes
From the Stereotype Specification dialog box, press Add and then select Text Tag from the popup menu.
This displays a new Tag entry.
To change the name of the Tag, double click to the Name field and enter a new name.
You can also change the type of Tag from Text to Model Element. To change the type, click on Type field and select a type from the popup menu.
To specify a default value of the Tag, double click to the Default Value field and enter a value.
Adding Model Element Tag to a stereotype
From the Stereotype Specification dialog box, press Add and then select Model Element Tag from the popup menu.
This displays a new Tag entry.
To change the name of the Tag, double click to the Name field and enter a new name.
You can also change the type of Tag from Text to Model Element. To change the type, click on Type field and select a type from the popup menu.
To specify a default value of the Tag, double click to the Default Value field and enter a value.
Adding Tagged Value to a Model Element
To add Tagged Value definitions to a model element:
- Right-click on a model element and select Open Specification...from the popup menu.
- The specification dialog box is displayed. Switch to the Tagged Value Definitions tab.
- Click Add. This displays two kind of tag for selection. One is Text Tag and another is Model Element Tag. Click on the desired one.
Adding Text Tag to Model Element
From the Stereotype Specification dialog box, press Add and then select Text Tag from the popup menu.
This displays a new Tag entry.
To change the name of the Tag, double click to the Name field and enter a new name.
You can also change the type of Tag from Text to Model Element. To change the type, click on Type field and select a type from the popup menu.
To specify a default value of the Tag, double click to the Value field and enter a value.
Adding Model Element Tag to a Model Element
From the Stereotype Specification dialog box, press Add and then select Model Element Tag from the popup menu.
This displays a new Tag entry.
To change the name of the Tag, double click to the Name field and enter a new name.
You can also change the type of Tag from Text to Model Element. To change the type, click on Type field and select a type from the popup menu.
To specify a default value of the Tag, double click to the Value field and enter a value.
Stereotype Formats
You can configure the formats of stereotypes including fill, line and font, so that stereotyped elements can be easily distinguished and emphasized in the diagram.
Configuring Stereotype Formats
- To configure stereotype formats, select menu Tools > Configure Stereotypes....
- In the Configure Stereotypes dialog box, select a model type in Model elements and the target stereotype in Stereotypes. Click the Edit... button.
- The Stereotype Specification is shown.
Applying Fill Color
- To apply fill color to stereotype, select the Use checkbox and click the ... button of the Fill property.
- Select a fill color in the Format Fill dialog box and click OK.
Applying Line Style
- To apply line style to stereotype, select the Use checkbox and click the ... button of the Line property.
- Configure the line style in the Format Line dialog box and click OK.
Applying Font
- To apply font to stereotype, select the Use checkbox and click the ... button of the Font property.
- Select a font in the Select Font dialog box and click OK.
After setting a stereotype to a shape, the formats of the stereotype will be applied to the shape immediately.
Changing Stereotype Formats
- Just like configuring stereotype formats, open the 'Configure Stereotypes' dialog box and select a model type in Model elements and the target stereotype in Stereotypes. Click the Edit... button to edit its fill, line and font in the Stereotype Specification.
- After changing stereotype formats, it is important that you ensure the 'Apply changes to stereotypes in current project' option is selected, otherwise the stereotypes used in the current project will not be updated.
- The appearances of shapes assigned to the changed stereotype are updated.
|
|
| Visual Paradigm International Limited |
| Website: |
www.visual-paradigm.com |
| E-mail: |
support@visual-paradigm.com |
|