Creating Operations and Attributes

On classes and interfaces, both operations and attributes appear in their own compartments. Expand and collapse the compartments by clicking the "+" or "-" symbols in the compartment's upper left corner as shown:

To create members for a class or interface:

  1. Right click on the class or interface in Diagram view or UML Navigator view.


  2. Select New > Attribute or New > Operation from the context menu. The member is inserted after the last attribute or operation.

Setting Visibility and Static Properties

You can set visibility modifiers for members of a class or interface by using the context menu for each element, or by using the Properties view.

Visibility modifiers include:

To set visibility for a member:

  1. Right click on the member in Diagram view.


  2. Select Visibility from the context menu. A submenu displays.


  3. Select from Public, Protected, Private, or Package Local.

Alternatively, use the Properties view for the member:

  1. Select the member on the diagram. The Properties view displays the associated properties for the member selected.


  2. Use the visibility field drop down list in the Properties view.

NB: You can also use the Properties view to designate members as static.

Showing Different Modeling Views

By default, the Diagram view reflects the classic UML modeling view. Modifiers are represented on the diagram in the following ways:

static: members are underlined.

public: members have a '+' symbol before the name.

private: members have a '-' symbol before the name.

protected: members have a '#' symbol before the name.

interface operations: display italicized.

Modify Together View Management preferences to show icons on class and package diagrams.

To show icons on class and package diagrams:

  1. From the menubar, select Window > Preferences. The Preferences dialog opens.


  2. From the options list on the left, expand Modeling node, and select View Management.


  3. Check Show Icons on Class and Package Diagrams.

Using Members from Classes

Use drag and drop to move the member into a new class. This is analogous to using Cut and Paste.