Control Shape Appearance with Stereotype

You can extend a model element from a stereotype to give it specific identify and specify its domain specific properties. Moreover, you can define formatting properties to stereotype, such as fill color and border style, to make model elements that extend the stereotype follow. In this tutorial, we will make use of a simple class diagram to show how to format a stereotype called API, and how to format an API class by applying stereotype.

April 1, 2010
User Rating: / 0
Views: 2,045
PDF Link Add comments
Edition: Community or above (Edition comparison)

  1. Download the project Simple-Shape-Generator.vpp attached to this tutorial.
  2. Start VP-UML in a new workspace.
  3. Open Simple-Shape-Generator.vpp and class diagram Simple Shape Generator. You can see the class diagram below.
    class diagram
  4. We want to model the fact that class Shape is an API class. We can do this by defining and applying an API stereotype. Select Tools > Configure Stereotypes... from the main menu.
    config stereotype
  5. In the Configure Stereotypes dialog box, expand the tree node Class, and select Class. Click Add... at the bottom.
    to add stereotype
  6. In the stereotype specification, enter API as name.
  7. Here you can see three options in the specification dialog box. They are Fill, Line and Font. By setting them, you can make classes that extend the API stereotype share the formatting properties defined. Let's try Fill first. Check Use for Fill. Click on the ... button. Select gray as color.
    change fill
  8. Similar, check Use for Line and edit its properties. Select a style of dotted line, set 3 as weight, blue as color.
    format line
  9. Finally, check Use for Font and edit its properties. Select a font you like (Comic Sans MS is used in this tutorial), set bold, and select 14 as font size, which makes the text bigger than default.
    set font
  10. Click OK to confirm the changes in Stereotype Specification. Click OK in Configure Stereotype dialog box to close it.
  11. Now, we need to make the class Shape extend the API stereotype. Right click on the class Shape and select Stereotypes > API from the popup menu.
    stereotype shape
  12. The appearance of class is updated to follow that defined for the stereotype API.
    final diagram

Resources

  1. Simple-Shape-Generator.vpp

Rate this Article

Click on one of the stars below to rate this article from 1 (lowest) to 5 (highest).

You may be interested in

  1. Writing Effective Use Case
  2. UML Package Diagram
    Tagged:
  3. Draw Entity Relationship Diagram (ERD)
    Tagged:
  4. Produce UML Use Cases from Business Process Diagram (BPD)
  5. Draw UML Sequence Diagram with Keyboard
Tags of this article:

Comments (0)

Write comment

Rating

Comment

Enter the calculation result

security code