Počni raditi s Gaphorom¶
Gaphor is more than a diagram editor: it’s a modeling environment. Where simple diagram editors such as Microsoft Visio and draw.io allow you to create pictures, Gaphor actually keeps track of the elements you add to the model. In Gaphor you can create diagrams to track and visualize different aspects of the system you’re developing.
Dovoljno priče, započnimo.
Instalacijske programe za Gaphor možeš pronaći na Gaphor web stranici. Gaphor se može instalirati na Linux (Flatpak), Windows i macOS sustave.
Nakon pokretanja Gaphora, prikazuje se uvodni ekran. Prikazuje prethodno otvorene modele i predloške modela.

Počni izborom predloška.
Generički: prazni model za započinjanje
UML: Predložak za Unified Modeling Language za modeliranje softverskog sustava
SysML: Predložak za Systems Modeling Language za modeliranje raznih sustavskih modela i sustava-od-sustava
RAAML: Predložak za Risk Analysis and Assessment Modeling language za sigurnost i analizu pouzdanosti
C4 Model: Predložak za kontekst, kontejnere, komponente i kod koji služi za jednostavno modeliranje softverske arhitekture
Nakon što se sučelje modela učita, vidjet ćeš sučelje za modeliranje.

Raspored sučelja Gaphora je podijeljen u četiri odjeljka, naime:
Preglednik modela
Kutija alata za elemente dijagrama
Dijagrami
Uređivač svojstva
Svaki odjeljak ima vlastitu specifičnu funkciju.
Preglednik modela¶
The Model Browser section of the interface displays a hierarchical view of your model. Every model element you create will be inserted into the Model Browser. 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 above, you will see that there are two elements in the Model Browser. 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 main element is a diagram.
In the Model Browser view, you can also right-click the model elements to get a context menu. This context menu allows you to find out in which diagram model elements are shown, add new diagrams and packages, and delete an element.
Double-clicking on a diagram element will show it in the Diagram section. Elements such as classes and packages can be dragged from the tree view on the diagrams.
Kutija alata¶
The toolbox is used to add new 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.
Tools can be selected by simply left-clicking on them. By default, the pointer tool is selected after every item placement. This can be changed by disabling the „Reset tool” option in the Preferences window. Tools can also be selected by keyboard shortcuts. The keyboard shortcut can be displayed as a tooltip by hovering over the tool button in the toolbox. Finally, it is also possible to drag elements on the Diagram from the toolbox.
Dijagrami¶
The diagram section contains diagrams of the model and takes up the most space in the UI because it is where most of the modeling is done. Diagrams consist of items placed on the diagram. There are two main types of items:
Elementi
Odnosi
Moguće je otvoriti više dijagrama odjednom: oni se prikazuju u karticama. Kartice se mogu zatvoriti pritiskom Ctrl+w ili pritiskom lijevog gumba miša na oznaku „x” u kartici dijagrama.
Elementi¶
Elements are the shapes that you add to a diagram, and together with Relations, allow you to build up a model.
To resize an element on the diagram, left-click on the element to select it and then drag the resize handles that appear at each corner.
To move an element on the diagram, drag the element where you want to place it by pressing and holding the left mouse button, and moving the mouse before releasing the button.
Veze¶
Veze su linijski elementi koji tvore odnose između elemenata u dijagramu. Svaki kraj veze se nalazi u jednom od dva stanja:
Spajanje s elementom – crvena ručka
Odspajanje od elementa – zelena ručka
Ako su oba kraja veze nepovezana, veza se može pomaknuti pritiskom lijeve tipke miša i povlačenjem.
A new segment in a relation can be added by left-clicking on the relation to select it and then by hovering your mouse over it. A green handle will appear in the middle of the line segments that exist. Drag the handle to add another segment. For example, when you first create a new relation, it will have only one segment. If you drag the segment handle, then it will now have two segments with the knee of the two segments where the handle was.
Kopiraj i umetni¶
As stated before, Gaphor is a modeling environment. This means that every item in a diagram is backed by a model element found in the model browser. This means that you can show the same model element in different diagrams.
Ctrl+v is used to paste only the presentation element.
Ctrl+Shift+v is used to paste a new presentation with a new model element.
Važno
Ctrl+v does a „shallow” paste. Ctrl+Shift+v does a „deep” paste.
Poništi i ponovi¶
Undo a change press Ctrl+z or left-click on the back arrow at the top of the Property Editor. To re-do a change, hit Ctrl+Shift+z or press the forward arrow at the top of the Property Editor.
Uređivač svojstva¶
Uređivač svojstva se nalazi na desnoj strani dijagrama. Kada na dijagramu nije odabran nijedan element, prikazuje neke savjete i trikove. Kada je jedan element odabran na dijagramu, on sadrži detalje o elementu poput imena, atributa i stereotipa. Može se otvoriti pomoću F9 i ikone u traci zaglavlja.
Prikazana svojstva ovise o odabranom elementu.
Postavke modela¶
Uređivač svojstva također sadrži postavke modela: Klikni gumb .
Automatski resetiraj alat¶
By default, the pointer tool is selected after an element is placed from the toolbox. If this option is turned off, the same type of element will be placed by clicking in the diagram until another element is selected in the toolbox.
Ukloni nekorištene elemente¶
Elementi koji nisu dio nijednog dijagrama u modelu će se standardno ukloniti. Ako je ova opcija isključena, elementi ostaju u modelu i mogu se pronaći u pregledniku modela.
Jezik dijagrama¶
Modifikator jezika dijagrama primjenjiv je samo na učitani model i način na koji je prikazan u dijagramu. Postavka jezika dijagrama sprema se kao dio modela i standardno je postavljena na engleski jezik.
Jezikom korisničkog sučelja Gaphora upravlja operacijski sustav.
Napomena
Gaphor uzima u obzir LANG varijablu okruženja na Linux, Windows i macOS sustavima.
Na operacijskim sustavima Windows i macOS jezik se može odabrati neovisno o postavkama jezika sustava.
Stilski predložak¶
Stilski predložak omogućuje mijenjanje vizualnog izgleda dijagrama i elemenata modela.