# Umbrello kasutamine

See peatükk tutvustab Umbrello kasutajaliidest ja selgitab kõike, mida vaja modelleerimise alustamiseks. Kõik Umbrello toimingud on kättesaadavad nii menüü kui tööriistaribade kaudu, lisaks pakub Umbrello laialdast kontekstimenüüde kasutamise võimalust. Klõpsates parema hiirenupuga ükskõik millisel Umbrello tööalal või puuvaates asuval elemendil avaneb kõiki selle elemendi kasulikke käske sisaldav menüü. Mõnede kasutajate jaoks on see alguses pisut segadusttekitav, sest nad on harjunud kasutama rohkem menüüd või tööriistaribasid, kuid pärast parema hiireklõpsuga harjumist kiirendab see sinu tööd tublisti.

## Kasutajaliides

Umbrello põhiaken on jagatud kolmeks alaks, mis aitavad anda sulle mudeliga töötades ülevaate kogu süsteemist ja kiire juurdepääsu erinevatele skeemidele.

Neid alasid nimetatakse:

- puuvaade

- tööala

- dokumentatsiooniaken

Umbrello kasutajaliides
Umbrello kasutajaliides

Umbrello kasutajaliides

### Puuvaade

Puuvaade asub põhiakna ülemises vasakus osas ja kuvab kõiki skeeme, klasse, tegijaid ja kasutusklasse, millest mudel koosneb. Puuvaade võimaldab saada kiire ülevaate mudelis sisalduvatest elementidest. Samuti võimaldab puuvaade lülitada kiirelt erinevate mudeli skeemide vahel ja lisada mudeli elemente skeemi.

Kui töötad mudeliga, mis sisaldab rohkem kui paari klassi ja skeemi, siis aitab puuvaate elementide kaustadesse jagamise võimalus sul asjade üle kontrolli hoida. Kaustu saab luua valides kontekstimenüüst sobiva käsu ja lohistades vajalikud elemendid õigetesse kaustadesse.

### Dokumentatsiooniaken

Dokumentatsiooniaken on pisike aken, mis asub Umbrello põhiakna alumises vasakus osas ja annab kiire ülevaate valitud elemendi dokumentatsioonist. Dokumentatsiooniaken on väike seepärast, et see on mõeldud elemendi dokumentatsioonile pilgu peale viskamiseks. Kui soovid näha elemendi dokumentatsiooni detailsemalt, siis ava elemendi omaduste dialoog.

### Tööala

Tööala on Umbrello akna põhiala, milles toimub põhiline tegevus. Tööala on kasutatakse mudeli skeemide redigeerimiseks ja vaatamiseks. Tööala kuvab aktiivset skeemi. Korraga on tööalal võimalik kuvada vaid ühte skeemi.

## Mudelite loomine, laadimine ja salvestamine

Umbrelloga millegi kasuliku tegemiseks on esimese asjana vaja luua või avada mudel. Umbrello käivitamisel laaditakse viimati kasutatud mudel või luuakse uus tühi mudel (vastavalt konfiguratsioonidialoogis määratud eelistustele).

### Uus mudel

Kui soovid mingil hetkel luua uut mudelit, siis saad seda teha valides menüüst Fail käsu Uus või klõpsates tööriistaribal nuppu Uus. Kui töötad hetkel mudeliga, mida on muudetud, siis küsib Umbrello, kas sa soovid enne uue mudeli laadimist eelmise mudeli muudatusi salvestada.

### Mudeli salvestamine

Mudelit on võimalik igal hetkel salvestada valides menüüst Fail käsu Salvesta või klõpsates tööriistaribal nuppu Salvesta. Kui soovid salvestada mudelit mõne teise nimega, siis kasuta menüüs Fail asuvat käsku Salvesta kui....

Ohutuse tagamiseks võimaldab Umbrello salvestada tööd ka kindla ajaintervalli tagant. Kui soovid seda kasutada, siis saad seadista see Umbrello menüüs Seadistused.

### Mudeli laadimine

Olemasoleva mudeli laadimiseks võid valida menüüst Fail käsu Ava või klõpsata tööriistaribal nuppu Ava. Tihtikasutatavatele mudelitele juurdepääsu kiirendamiseks on hiljuti kasutatud mudelite nimekiri saadaval menüü Fail alamenüüs Ava hiljutine.

Umbrello võimaldab töötada korraga vaid ühe mudeliga, seepärast, kui käsed rakendusel avada järgmise mudeli ja juba avatud mudelit on pärast viimast salvestamist muudetud, siis küsib Umbrello, kas soovid tehtud muudatusi salvesta.

## Mudelite redigeerimine

Mudeli elementide redigeerimiseks Umbrellos on kaks põhimoodust.

- mudeli elementide redigeerimine puuvaate kaudu

- mudeli elementide redigeerimine skeemi kaudu

Using the context menu of the different items in the Tree View you are able to add, remove, and modify almost all the elements in your model. Right clicking on the folders in the Tree View will give you options for creating the different types of diagrams as well as, depending on whether the folder is a Use Case View or a Logical View, Actors, Use Cases, Classes, etc.

Once you have added elements to your model you can also edit an element by accessing its properties dialog, which you find by selecting the option Properties from the context menu shown when right clicking on the items in the Tree View.

You can also edit your model by creating or modifying elements through diagrams. More details on how to do this are given in the following sections.

## Skeemide lisamine ja eemaldamine

Your &UML; model consists of a set of &UML; elements and associations between them. However you cannot see the model directly, you use Diagrams to look at it.

### Skeemide loomine

To create a new diagram in your model simply select the diagram type you need from the New submenu in the Diagram menu and give a name to it. The diagram will be created and made active, and you will immediately see it in the tree view.

Remember that &umbrello; makes extensive use of context menus: you can also &RMB; click on a folder in the Tree View and select the appropriate diagram type from the New submenu in the context menu. Note that you can create Use Case Diagrams only in Use Case View folders, and the other types of diagram can only be created in the Logical View folders.

### Skeemide eemaldamine

Should you need to remove a diagram from your model, you can do this by making it active and selecting Delete from the Diagram Menu. You can also achieve this by selecting Delete from the diagrams context menu in the Tree View

Since deleting a Diagram is something serious that could cause loss of work if done by accident, Umbrello will ask you to confirm the delete operation before actually removing the Diagram. Once a diagram has been deleted and the file has been saved there is no way to undo this action.

### Skeemide ümbernimetamine

If you want to change the name of an existing diagram you can easily do this by selecting the Rename option from its &RMB; menu in the Tree View.

Another way to rename a diagram is to do this via its properties dialog, which you obtain by selecting Properties from its Context Menu or by double clicking on it in the Tree View.

## Skeemide redigeerimine

When working on a diagram, &umbrello; 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.

### Elementide lisamine

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 far right of the application window, Umbrello 1.2 has moved this to the top of the window. You can dock it into other edge or have it floating around if you prefer. 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.

### Elementide kustutamine

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.

### Elementide redigeerimine

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 (&RMB; 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 most &UML; elements you can also open the properties dialog by double clicking on it if you are using the selection tool (arrow). The exception to this is Associations, in which case a double click creates an anchor point. For associations you need to use the &RMB; context menu to get the properties dialog.

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.

### Klasside redigeerimine

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.

#### Klassi üldseadistused

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.

#### Klassi atribuutide seadistused

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.

#### Klassi operatsioonide seadistused

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

#### Klassi mallide seadistused

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

#### Klassi sidemete seadistused

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 be 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.

#### Klassi kuvamise seadistused

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

#### Klassi värvide seadistused

In the Widget Color 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.

### Sidemed

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; 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.

#### Ankurpunktid

Associations are drawn, by default, as a straight line connecting the two objects in the diagram. If you want to make the association line bend to improve the visibility of your diagram, you can do this by inserting anchor points to break the association line in several segments.

You can add anchor points 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.

### Märkused, tekstid ja kastid

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.

#### Ankrud

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.