|
Applying
the new stereotype to new classes
Create a new class by selecting the Create a Class
green icon in the class diagram toolbar > Drag the selected
element to the diagram editor > Drop at the place where
you want the class be created.

In the first page of the wizard, edit the
Name field (e.g. Employees)
and click on the next button.

Click on the New Stereotype button.

Use the arrow to scroll the available
stereotypes and select the stereotype defined in the associated UML2
profile which is labeled Example::MyStereotype.
Note that all available stereotypes come
from the to the
project.

Select the stereotype attribute and add a
value by clicking on the Edit button.

Edit the Value
field and
click on the OK button.

The UML properties are displayed in the New
Java Class wizard. Click on the Finish button.

Note that the class Employee and its
stereotype have been created inside the class diagram editor.
Applying the new
stereotype to existing classes
Select the Create a class icon in the
class diagram toolbar and drag the link to the contextual menu, edit
the Name field (e.g. Company)
and click on the finish button.

Right click on Company class inside the
class diagram to open the popup menu > Properties.

In the first tab of the dialog, select
the New Stereotype button.

Scroll the available stereotypes.

Select "Example::MyStereotype" stereotype in
the Stereotype field.

Note that a new tab labeled Example Example::MyStereotype appears in
the Class properties dialog. The content of this tab is defined by
the sample Omondo Profile. Implementors have acces to the metamodel to
fill the controls of this tab (for the purpose of this tutorial, this
tab has no controls).

Applying
the new stereotype to associations
Selecting the Association
icon from the class diagram toolbar.

Click the left mouse button on the
Employee class element and drag the link from the Employee Class to
the Company class. Drop when the Company class is highlighted.

Select the Properties tab and add a new
stereotype by clicking on New Stereotype button.

Use the arrow to scroll the available
stereotypes and select Example::MyStereotype.
Click on the OK button to
return to the properties dialog.

Note that the Example::Mystereotype
stereotype has been added to the stereotype list and the new tab
labeled Example Example::MyStereotype.
It is possible
to change the stereotype attribute value by using the Edit button.

Add a new value (e.g. another value) and
click on the OK button to return to the properties
dialog.

Note that the Properties tab has
been updated and includes the new stereotype attribute value. Click on the OK
button to perform the changes.

Note that stereotypes have been added to Employee and Company classes, and also to the
association. In the same
way, you can add stereotypes to other types of elements such as
methods, attributes, dependencies, etc...

|