Editing Diagrams

When working on a diagram, Umbrello UML Modeller will try to guide you by applying some simple rules as to which elements are valid in the different types of diagrams, as well as the relationships that can exist between them. If you are an UML expert you will probably not even notice it, but this will help UML novices create standard-conformant diagrams.

Once you have created your diagrams it is time to start editing them. Here you should notice the (for beginners subtle) difference between editing your diagram, and editing the model. As you already know, Diagrams are views of your model. For example, if you create a class by editing a Class Diagram, you are really editing both, your Diagram and your model. If you change the color or other display options of a Class in your Class Diagram, you are only editing the Diagram, but nothing is changed in your model.

Insert Elements

One of the first things you will do when editing a new diagram is to insert elements into them (Classes, Actors, Use Cases, etc.) There is basically two ways of doing this:

  • Dragging existing elements in your model from the Tree View

  • Creating new elements in your model and adding them to your diagram at the same time, by using one of the edit Tools in the Work Toolbar

To insert elements that already exist in your model, just drag them from the Tree View and drop them where you want them to be in your diagram. You can always move elements around in your Diagram using the Select Tool

The second way of adding elements to your diagram is by using the Work Toolbar's edit tools (note that this will also add the elements to your model).

The Work Toolbar was by default located on the top of the window. The tools available on this toolbar (the buttons you see on it) change depending on the type of diagram you are currently working on. The button for the currently selected tool is activated in the toolbar. You can switch to the select tool by pressing the Esc key.

When you have selected an edit tool from the Work Toolbar (for example, the tool to insert classes) the mouse pointer changes to a cross, and you can insert the elements in your model by single clicking in your diagram. Note that elements in UML must have a Unique Name. So that if you have a class in one diagram whose name is ClassA and then you use the insert Class tool to insert a class into another diagram you cannot name this new class ClassA as well. If these two are supposed to be two different elements, you have to give them a unique name. If you are trying to add the same element to your diagram, then the Insert Class is not the right tool for that. You should drag and drop the class from the Tree View instead.

Deleting Elements

You can delete any element by selecting the option Delete from its context menu.

Again, there is a big difference between removing an object from a diagram, and deleting an object from your model: If you delete an object from within a diagram, you are only removing the object from that particular diagram: the element will still be part of your model and if there are other diagrams using the same element they will not suffer any change. If, on the other hand, you delete the element from the Tree View, you are actually deleting the element from your model. Since the element no longer exist in your model, it will be automatically removed from all the diagrams it appears in.

Editing Elements

You can edit most of the UML elements in your model and diagrams by opening its Properties dialog and selecting the appropriate options. To edit the properties of an object, select Properties from its context menu (right mouse button click). Each element has a dialog consisting of several pages where you can configure the options corresponding to that element. For some elements, like actors you can only set a couple of options, like the object name and documentation, while for other elements, like classes, you can edit its attributes and operations, select what you want to be shown in the diagram (whole operation signature or just operation names, etc) and even the colors you want to use for the line and fill of the class' representation on the diagram.

For UML elements you can also open the properties dialog by double clicking on it if you are using the selection tool (arrow).

Note that you can also select the properties option from the context menu of the elements in the Tree View. This allows you to also edit the properties for the diagrams, like setting whether the grid should be shown or not.

Editing Classes

Even though editing the properties of all objects was already covered in the previous section, classes deserve a special section because they are a bit more complicated and have more options than most of the other UML elements.

In the properties dialog for a class you can set everything, from the color it uses to the operations and attributes it has.

Class General Settings

The General Settings page of the properties dialog is self-explanatory. Here you can change the class' name, visibility, documentation, etc. This page is always available.

Class Attribute Settings

In the Attributes Settings page you can add, edit, or delete attributes (variables) of the class. You can move attributes up and down the list by pressing the arrow button on the side. This page is always available.

Class Operations Settings

Similar to the Attribute Settings Page, in the Operation Settings Page you can add, edit, or remove operations for your class. When adding or editing an operation, you enter the basic data in the Operation Properties dialog. If you want to add parameters to your operation you need to click the New Parameter button, which will show the Parameter Properties dialog. This page is always available

Class Template Settings

This page allows you to add class templates which are unspecified classes or datatypes. In Java 1.5 these will be called Generics.

Class Associations Page

The Class Associations page shows all the associations of this class in the current diagram. Double clicking on an association shows its properties, and depending on the type of association you may modify some parameters here such as setting multiplicity and Role name. If the association does not allow such options to be modified, the Association Properties dialog is read-only and you can only modify the documentation associated with this association.

This page is only available if you open the Class Properties from within a diagram. If you select the class properties from the context menu in the Tree View this page is not available.

Class Display Page

In the Display Options page, you can set what is to be shown in the diagram. A class can be shown as only one rectangle with the class name in it (useful if you have many classes in your diagram, or are for the moment not interested in the details of each class) or as complete as showing packages, stereotypes, and attributes and operations with full signature and visibility

Depending on the amount of information you want to see you can select the corresponding options in this page. The changes you make here are only display options for the diagram. This means that hiding a class' operations only makes them not to be shown in the diagram, but the operation are still there as part of your model. This option is only available if you select the class properties from within a Diagram. If you open the class properties from the Tree View this page is missing since such Display Options do not make sense in that case

Class Style Page

In the Widget Style page you can configure the colors you want for the line and the fill of the widget. This option obviously makes sense only for classes displayed in diagrams, and is missing if you open the class' properties dialog from the Tree View.

Associations

Associations relate two UML objects to each other. Normally associations are defined between two classes, but some types of associations can also exists between use cases and actors.

To create an association select the appropriate tool from the Work Toolbar (generic Association, Generalization, Aggregation, etc.) and single click on the first element participating in the association and then single click on the second item participating. Note that those are two clicks, one on each on the objects participating in the association, it is not a drag from one object to the other.

If you try to use an association in a way against the UML specification Umbrello UML Modeller will refuse to create the association and you will get an error message. This would be the case if, for example, a Generalization exists from class A to class B and then you try to create another Generalization from Class B to class A

Right clicking on an association will show a context menu with the actions you can apply on it. If you need to delete an association simply select the Delete option from this context menu. You can also select the Properties option and, depending on the association type edit attributes such as roles and multiplicity.

Anchor Points

Associations are drawn, by default, as a straight line connecting the two objects in the diagram.

You can add anchor points to bend an association by double clicking some where along the association line. This will insert an anchor point (displayed as a blue point when the association line is selected) which you can move around to give shape to the association

If you need to remove an anchor point, double click on it again to remove it

Note that the only way to edit the properties of an association is through the context menu. If you try to double click on it as with other UML objects, this will only insert an anchor point.

Notes, Text and Boxes

Notes, Lines Of Text and Boxes are elements that can be present in any type of diagram and have no real semantic value, but are very helpful to add extra comments or explanations that can make your diagram easier to understand.

To add a Note or a Line Of Text, select the corresponding tool from the Work Toolbar and single click on the diagram where you want to put your comment. You can edit the text by opening the element through its context menu or in the case of notes by double clicking on them as well.

Anchors

Anchors are used to link a text note and another UML Element together. For example, you normally use a text note to explain or make some comment about a class or a particular association, in which case you can use the anchor to make it clear that the note belongs to that particular element.

To add an anchor between a note and another UML element, use the anchor tool from the work toolbar. You first need to click on the note and then click on the UML element you want the note to be linked to.