To create a Class diagram, go to [Diagram] – [Class Diagram].
You can automatically generate Class diagrams from a package.
Generate a class diagram without Attributes and Operations inside the classes.
Generates a class diagram including Attributes and Operations inside the classes.
Generates a class diagram with all models, including those in sub-packages if present.
There are five ways to create a Class in the Diagram Editor. Refer to the Diagram Editor page for more details.
You can create a Template Class by adding Template Parameters to a class. There are two ways to do so.
You can create Attributes by hovering over a Class and clicking the orange diamond that appears.
Alternatively, hit the [Enter] key while an attribute is selected to create another.
You can also add Attributes by pasting copied text.
To show/hide attributes,
1. Open the [Initial Visibility] tab in the bottom-left pane.
2. Select the options and click [Apply to existing elements] to apply them to the diagram.
You can create Operations by hovering over a Class and clicking the green bar that appears.
Another way is to press the [Enter] key while an operation is selected.
Attributes and operations can be moved by dragging them within a class or to another class.
Since version 8.5, you can add Operations by pasting copied text.
You can create an anonymous bound class by deleting the name of a Bound Class.
Anonymous Bound Classes can be specified to the following:
You can nest a class within a package by dragging it into the package.
Since version 10.0, creating Enumerations is simpler:
1. Choose [Enumeration] from the Class drop-down menu on the tool palette.
2. Click on a diagram editor to place it.
There are three ways to create Enumeration Literals.
1. Using Draw Suggest:
Hover over and Enumeration and click the purple mini bar to add a new enumeration literal.
2. Using Context Menu:
Right-click on an Enumeration and select [Add Enumeration Literal].
3. From Property view:
Select an Enumeration, then in the property view(bottom-left pane), click [Enumeration Literal] tab and click [+].
To create associations, hover over a Class, select the appropriate association type from the icons, and click the target models. For more details, see the “Drawing Lines” section.
You can navigate to the Association ends by right-clicking the association line and selecting [Move to related element].
If association names drift from the line, right-click the line and select [Init Label Position] to reset the label’s position.