Create a Class diagram

Go to [Diagram] – [Class Diagram] to create a Class diagram.
Create Class Diagram menu

section divider

Auto-create diagram

You can auto-create diagrams with all the models in the project.

  1. If you have source code, import first then auto-create a Class diagram.
    How to import Java source code
    Use Plug-ins to import source code (C++, C#, and Java)
  2. Right-click on a package in a tree view and select [Auto Create Class Diagram]
    Auto-create Class Diagrams

  3. Then a class diagram will be generated automatically.
    • [Auto Create Detailed Class Diagram] will include Attributes and Operations on the diagram, and the other option does not.
section divider

Class

Creating a Class

You can find out 5 ways to create a Class in the Diagram Editor page.
UML Class


Template Class

You can create a Template Class by adding Template Parameters to a class. There are two ways to do so.
Template-class

  1. Select [Add Template Parameter] from Class’s Pop-up menu
    Adding a template class

  2. Define details at the bottom-left pane under [Template Class].
    Template-class-property

Attributes

You can create Attributes by clicking the orange diamond that appears when you have a mouse over a Class.
Attribute-diamond

Also, you can create another attribute by hitting [Enter] key while an attribute is selected.
Creating Attributes


Operations

You can create Attributes by clicking a green bar that appears when you have a mouse over a Class.
Green bar to add operations

Also, you can create another attribute by hitting [Enter] key while an attribute is selected.
Methods to Class

Moving Attributes/Operations

You can move around attributes/operations by dragging them to another class or within a class.
Moving attributes


Anonymous Bound Class

You can create an anonymous bound class by deleting the name of Bound Class.
Anonymous Bound Class

Anonymous Bound Classes can be specified to the following:

  • Attribute Type
  • Operation Return Value
  • Operation Parameter Type
  • The target of Association End A and Association End B
  • Base Class of Instance Specification in Class
  • Base Class of Object Node in Activity Diagram
  • Base Class of Lifeline in Sequence Diagram and Communication Diagram

Example of creating a Bound Class

  1. Create a abound class.
  2. Create a new class and add an attribute whose type is bound class to it.
    Bound Class

  3. When you add the class, you will be asked if you’d like to create a new class. Click [Yes].
    Box to ask a new class

  4. Click [Show Hidden Relationship] from its pop-up menu.
    Show hidden menu

  5. Then you will get the relationship of the anonymous bound class.
    Anonymous Bound Class


Nest a Class

You can have a class nested to a package by dragging it into a Package.
Nested Class