# Class instance

A class instance may be placed under a class view, a use case view or a use case.

## Menus

The class menu appearing with a right mouse click on its representation is something like this, supposing the instance not read-only nor deleted (see also menu in a diagram) :

### Menu : edit

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

#### Class dialog, tab Uml

The button class shows a menu proposing :

- to select in the browser the class of the instance

- if the instance is not read-only and if a class is selected in the browser : to set the class of the instance to be this class

- if the view containing the class containing the instance is not read-only : to create a new class and to set the attribute type to it

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

#### Class dialog, tab Attributes

This tab allows to specify the value of the attributes of the instance, including the inherited ones :

Unfortunately an attribute can't be set several times, this is a problem when an attribute has a multiplicity greater than 1.

#### Class dialog, tab Relations

This tab allows to specify the value of the relations of the instance, including the inherited ones:

Unfortunately a relation can't be set several times, this is a problem when a relation has a multiplicity greater than 1.

### Menu : duplicate

The menu entry duplicate clone the class instance, except the value of the relations.

### Menu : referenced by

To know who reference the current class instance

### Menu : mark

See mark

### Menu : delete

The menu entry delete is only present when the class instance is not read-only.

Delete the instance and all the representation of it 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 : tool

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

## Drawing

### Sequence diagrams

A class instance is drawn in a sequence diagram as a rectangle or an icon depending on the class's stereotype and the drawing settings, the value of the attributes and relations don't appears :

A right mouse click on a class instance in a sequence diagram calls the following menu (supposing the instance editable) :

Please refer to the chapter sequence diagram for more details.

### Collaboration diagrams

A class instance is drawn in a collaboration diagram as a rectangle, the value of the attributes and relations don't appears :

A right mouse click on a class instance in a collaboration diagram calls the following menu (supposing the instance editable) :

Please refer to the chapter collaboration diagram for more details.

### Object diagrams

A class instance is drawn in a collaboration diagram as a rectangle, the value of the attributes and relations appears :

A right mouse click on a class instance in an object diagram calls the following menu (supposing the instance editable) :

Please refer to the chapter object diagram for more details.

Previous : extra member

Next : state