Working with Gaphor
###################

Once Gaphor is launched, it provides you an almost empty user interface. A new model is already created and the diagram is opened.

The layout of the Gaphor interface is divided into four sections, namely:

* Navigation
* Main Canvas Diagram
* Diagram Element Toolbox
* Properties pane

Each section has it's own specific function.

Navigation
==========

.. image:: gaphor-treeview.png

In Gaphor, you use the navigation section of the interface to get a hierarchical view of your model.  Every model element you create will be inserted in the navigation section.  This view acts as a tree where you can expand and collapse different elements of your model.  This provides an easy way to view the elements of your model from an elided perspective.  That is, you can collapse those model elements that are irrelevant to the task at hand.

In the figure on the left, you will see that there are three elements in the navigation view.  The root element, `New Model` is a package.  Notice the small arrow beside `New Model` that is pointing downward.  This indicates that the element is expanded.  You will also notice the two sub-elements are slightly indented in relation to `New Model`.  The `NewClass` element is a class and the `main` element is a diagram.

In the navigation view, you can also right-click the model elements to get a context menu.  This context menu allows you to delete model elements, and to refresh the navigation view.

Double clicking on a diagram element will open it in the Diagram section. Elements such as classes and packages can be dragged from the tree view on the diagrams.

Diagram section
===============

The diagram section takes up the most space. Multiple diagrams can be opened at once: they are shown in tabs. Tabs can be close from the file menu (Close) and by pressing `Ctrl+w`.

Most element have "hot zones", shown as gray rectangles that are only visible when the item is selected. Double clicking on those rectangles allows you to directly edit the item. E.g. change it's name or change the name of an association end.

Toolbox
=======

The toolbox is mainly used to add new diagram items to a diagram. Select the element you want to add by clicking on it. When you click on the diagram, the selected element is created. The "arrow" is selected again, so the element can be manipulated.

Element Editor
==============

The Element editor is not really part of the main screen, it's a utility window that shows all characteristics of the selected element. Things like name, attributes and stereotypes.

.. image:: elementeditor.png

The properties shown depend on the element that is selected.
