| Free tutorials for Java, Eclipse and Web programming |
The following example will create a class diagram with the UML2 tools.
Create a new java project "de.vogella.uml2.first" and a new folder "uml2". Right click on the folder "uml2", select New-> Other. Select UML 2.1 Diagrams and then the "class diagram" as the type.
In my example I will create a class diagram.

Define the name of you diagram as "myclasses.umlclass".

Press finish.
From the "Palette" you can now select the type of element you would like to create. For example Select "Class" and click in the whitespace to create the UML representation of a class.

The result should look like the following.
The properties view allow you to change the attributes of the elements. To open the properties view select a class, right mouse click and select "Show Properties View". You can then for example set the "Is Abstract" flag to true to create a abstract class.
If you select your element a menu will be displayed which allows you to add property (fields) and operations (methods).
If you select your UML diagram and click on the outgoing arrow you can create associations.

Save your UML diagram.

You can maintain the relationship multiplicity between two classes by clicking on the association and via the properties lower / upper in the property view.

UML2 Tool let you choose if you want to use the ball-and-socket notation (interface is displayed as a circle) or UML stereotype <<interface>> for the representation of an interface. Simple right click on the interface and select "Show as class" of "Collapse to circle".
