3.1. Creating UML Diagrams
The following example will create a class diagram with the UML2 tools.
Create a new java project "sawan.modi.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.
Tip
You can edit the properties and the operations names directly in the diagram. According to the UML specification the name of an operation should be followed by round brackets, e.g. you can type foo() but not foo for a operation.Save your UML diagram.
Tip
Note that your UML diagram updates the *.uml file. In case you deleted your diagram you can re-create the diagram from the .uml file, via the right mouse click and by selecting the "Initialize * class diagram" entry in the menu.
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 <
1 comments:
how can i color a class diagram?
Is there any way to color a class diagramby reading .uml file of that class diagram?
Post a Comment