# Collaboration diagram

The collaboration diagrams may be placed in a use case view or a use case

A collaboration diagram is created through the new collaboration diagram entry of the use case view and use case browser menus.

## Browser menu

The node menu appearing with a right mouse click on its representation in the browser is something like these, supposing the diagram not read-only nor deleted :

### Browser Menu : show

show allows to show the diagram picture, and edit it in case it is not read only.

### Browser Menu : edit

edit allows to show/modify the diagram properties. In case the diagram is read-only, the fields of the dialog are also read-only.

#### collaboration diagram dialog, tab Uml

The proposed stereotypes are the default one specified through the Default stereotypes dialog more the current one (empty here). It is possible to choose into the list or to give a new one, or to empty it. The stereotype of a diagram doesn't have a special meaning for BOUML.

The editor button visible above and associated here to the description, allows to edit the description in an other window, or to call an external editor (for instance Xcoral) specified through the environment variable BOUML_EDITOR. Note that this external editor have to create an own window, its parameter is the pathname of the file containing the description, its execution is done in parallel with BOUML which looks each second at the file contents to get the new definition until the dialog is closed (I do not like very much this polling but this works even QT isn't compiled with the thread support).

### Browser Menu : edit drawing settings

This dialog allows to specify how the items of the diagram must be drawn by default, you may choose default for each value, in this case the effective value if specified in the upper level (which itself may specify default etc ... up to the project level).

- drawing language : to indicate in which language the operations must be written when the full definition is showed (see below), like for the class drawing in a class diagram. For instance, the class C has the operation op returning an int (supposed translated int in C++ and Java, octet in Idl) and having the input parameter p having the type uchar (supposed translated unsigned char in C++, char in Java and octet in Idl). Depending on the drawing language :

- show operations full definition : to show all the operation profile or just its name (may be with the arguments specified at the operation level in the diagram, see edit)

- show hierarchical rank : a message may be numbered using its rank (a simple number) or its hierarchical rank (numbers separated with dot)

- write class instance horizontally : To write the instance type and name on the same line, or on two lines

### Browser Menu : duplicate

Clone the diagram in a new one

### Browser Menu : delete

The delete entry is only present when the diagram is not read-only.

Delete the diagram and all its representation in the opened diagrams. After that it is possible to undelete it (from the browser) until you close the project : obviously the deleted items are not saved !

### Menu : mark

See mark

### Browser Menu : tools

The menu entry tool is only present in case at least a plug-out may be applied on the diagram. The selected tool is called and applied on the current diagram.

## Picture menu

The diagram menu appearing with a right mouse click out off any item in the diagram picture is something like these, supposing the diagram not read-only :

### Picture Menu : edit all the messages

To edit all the messages appearing in the diagram, to change the messages themselves or their numbering (recursively or not), or delete some of them (recursively or not) :

The proposed messages are the operations defined on the message receiver more the current one, but you may also give any other message.

A mouse click on the appropriate line and column allows to modify the appropriate cell.

### Picture Menu : edit drawing settings

see edit drawing settings.

### Picture Menu : select all

Select all the items of the current diagram, also done through a control a

### Picture Menu : optimal scale

similar to the fit scale button, change scale to see all the diagram's elements at great as possible

### Picture Menu : optimal window size

change the size of the windows to see all the diagram's elements with the current scale

### Picture Menu : copy visible part

Put the visible part of the current diagram in the clipboard (copy), it is a screen copy, the current scale have impact on the picture quality.

It is also possible to print all (not only the visible part) the current diagram on printer or a file through the button

### Picture Menu : set preferred size and scale

To memorize the current diagram sub window size and the current scale. These ones will be used the next time the diagram will be opened.

### Picture Menu : restore preferred size and scale

In case a preferred sub window size and preferred scale was set, follow them.

### Picture Menu : format

By default the diagram's canvas size is 840 x 1188 points corresponding to an iso A4 format (210*4 x 297*4), all the available formats are :

- iso A5 : 592 x 840

- iso A4 : 840 x 1188

- iso A3 : 1188 x 1680

- iso A2 : 1680 x 2376

- USA A : 864 x 1116

- USA B : 1116 x 1728

- USA C : 1728 x 2236

### Picture Menu : undo changes

Undo all the changes made since the diagram was opened the last time. Note that the diagram is restored independently of the the project saving. Obviously the deleted browser items was not restored !

## Operation/message Menu

The menu appearing with a right mouse click on link is something like these, supposing the diagram not read-only :

The two first entries allows to add a message in each direction, you have to choose the new message rank among the proposed ones, but you may change it after with edit its message or edit all the messages. For instance in case a new message is added from from the keyboard great to a stop (see the first picture), the proposed ranks are :

### Message Menu : edit its message

edit allows to edit the message of the link, or delete some of them (recursively or not), see edit.

### Message Menu : edit all the messages

To edit all the messages appearing in the diagram, to change the messages themselves or their numbering (recursively or not), or delete some of them (recursively or not), see edit.

### Message Menu : edit drawing settings

This dialog allows to specify how the operation/message must be drawn, you may choose default for each value, in this case the effective value if specified in the upper level (which itself may specify default etc ... up to the project level).

see operation drawing language and show full operation definition.

### Message Menu : select linked items

Select linked items select all the items connected this the current one through any line.

## Class instance Menu

The menu appearing with a right mouse click on a class instance is something like these, supposing the diagram not read-only :

### Message Menu : edit drawing settings

This dialog allows to specify how a the class instance must be drawn, you may choose default for each value, in this case the effective value if specified in the upper level (which itself may specify default etc ... up to the project level).

write class instance horizontaly : To write the instance type and name on the same line, or on two lines.

## Default stereotypes

The dialog allowing to set the default stereotypes has a tab reserved for the diagrams :

## Drawing

A collaboration diagram may contain actors, classes instances, notes, texts, diagram icons and the operations/messages.

To place these elements in the diagram, use the buttons on the top (to create a new element or choose from the already defined ones) then click at the appropriate position in the diagram, or grab the element from the browser into the diagram.

To add an operation/message on an already existing link, double mouse click on it or use the menu appearing though a right mouse click.

The scale may be changed from 30 up to 200 %. To allows to see the operation/message kinds even with a small scale, the size of the arrows is unmodified.

fit% allows to set the largest scale allowing to show all the picture, as it is possible. Because of the scrollbar management, hitting several times on fit% may give several scales.

Classically, the left mouse click may be used to select an element, or several when the control key is down, a multiple selection may also be done defining a region using the mouse left click out of any element and moving the mouse with the click and maintaining the click down. The diagram's elements may be moved after a left mouse click on an element and maintaining the click down during the mouse move. The right mouse click is used to show context dependent menus.

control s is a shortcut to save the project

control a is a shortcut to select all the diagram's elements

control d is a shortcut to delete the selected element(s), the model is affected

suppr is a shortcut to remove the selected element(s) from the diagram, these elements are not deleted

control c is a shortcut to copy the selected diagram's elements

control x is a shortcut to cut (remove from view) the selected diagram's elements

control v is a shortcut to paste the selected diagram's elements

When several diagram's elements are selected, the menu appearing on a left mouse click allows to align them :

### Note

A note may contain any text, a note is resizeable. To change the text of a note choose the edit entry of its menu or double click on it, this open a window containing the text, close the window to end the edition :

A right click on the edited note calls a dialog allowing some text manipulations thanks Qt.

A right mouse click on a note show the following menu :

The font may be changed, by default the font is the one used to write the other texts.

Edit drawing settings allows to change the fill color

Select linked items select all the items connected this the current one through any line, in the previous picture this select all except the package, the text “upper diagram :” and the use case diagram icon.

### Text

Text is another way to write a text, contrary to the note a text is written alone (see “upper diagram :” on the picture below), by default a text contains blabla: a text cannot be empty. The edition of a text is done like for a note. A text is resizeable, a resize is not automatically done when the contains is modified.

A right mouse click on a text show the following menu :

### Diagram icon

A diagram icon is a shortcut to a diagram, this allows to quickly navigate through the diagram without limitation (a actor or some other item kinds may be associated to only one diagram). The used icon indicates the diagram kind, but its name is not written.

A double mouse left click on a diagram icon opens the diagram, the open entry of the diagram icon menu does the same thing.

A right mouse click on a diagram icon show the following menu :

The other diagram's elements have an own chapter, refer to them.

Previous : sequence diagram

Next : class diagram