This section provides techniques for creating classes, linking and unlinking classes, and showing classes in sequence or collaboration diagrams.
Use the context menu of an actor or object to create a new class or interface. Double-clicking the actor or object displays the source code in the Editor.
To create a new class or interface:
Select the actor or object on the sequence diagram.
Right click on the element and choose New > Class or New > Interface. The New Object's Class dialog displays.
Enter information required by the dialog to create a new class, and then click Finish
NB: When selecting to create a new interface, the New Object's Interface dialog displays.
Use the context menu of an actor or object element to link it with a class. After the association has been made, double-clicking the element displays the source code of the linked class.
To link an actor or object to a class:
Select the actor or object on the sequence diagram.
Right click on the Actor/Object and choose Select Class from the context menu. The Select Class command expands to display:
a submenu that shows any classes that are "local" to the diagram.
the More option for browsing classes that you can associate with the actor or object.
Choose a class from the list, or select More to associate a class that is not local to the diagram. This renames the actor or object to the chosen class's name.
TIP: You can associate multiple objects with the same class. Use CTRL + click to select the objects, and follow the steps above to associate the objects to a class.
To unlink a class from an actor or object:
Select the actor or object on the sequence diagram.
Right click and select Unlink Class from the context menu.
Once a class has been associated with an actor or object, use the context menu to show the class in the editor, resource navigator, package explorer, or model navigator. Right click on the element, and select Show Class > In Editor (Navigator, Package Explorer, or UML Navigator).
Alternatively, to show the source code of a class in the editor, double-click the element in the sequence diagram. The source code displays highlighting the class name.