Getting started with UmlCraft
This guide is for you if you have never used UmlCraft, or a UML tool of its kind. It takes about fifteen minutes. What UmlCraft can do in full is in the README.
The one idea to understand first
UmlCraft looks like a drawing program, but it is not one. A drawing program keeps shapes: a box with some text in it, a line between two boxes. UmlCraft keeps a model: the classes, actors, states and other elements of what you describe, and the relationships between them. A diagram is a view of part of that model.
Think of the people in a photo album. A person exists once; each photo shows some of them. The same person can be in many photos. Taking someone out of one photo does not remove them from the others, let alone from the world.
In UmlCraft:
- A class
Customerexists once in the model, however many diagrams show it. - Every diagram that shows
Customershows the same class. Rename it or give it an attribute on one diagram, and every other diagram shows the change. - A line between two classes is a relationship of the model, not just a line. It belongs to the two classes, not to the drawing.
- The model tree on the left lists everything the model holds, also what no diagram shows. It is the real content of your project; the diagrams are views of it.
So the question "what is on my diagram?" has two parts: what exists in the model, and which of it this diagram shows, where and how.
| What you want | In a drawing program | In UmlCraft |
|---|---|---|
| Show a class on a second diagram | Copy and paste the box | Drag the class from the model tree onto the diagram, or copy it and paste it with Ctrl+Shift+V |
| Rename a class everywhere | Edit every box | Rename it once |
| Take a box off one diagram | Delete it | Remove from diagram (Ctrl+Delete): it stays in the model and on other diagrams |
| Get rid of a class altogether | Delete it on every page | Delete from model (Delete): it disappears from every diagram, with its lines |
| Make a second, independent class | Copy and paste | Copy and paste (Ctrl+C, Ctrl+V): the copy is a new element |
Delete and Remove from diagram are the two commands to remember. The Delete key deletes from the model. If you only meant to tidy one diagram, press Ctrl+Z and use Ctrl+Delete instead. Every change can be undone.
The window
- Title bar, at the very top: Save, Undo, Redo and the project's name, and on the right About UmlCraft and the settings (the gear).
- Ribbon, below it, with its tabs on top. File opens a page over the window for new, open, save, import and export; Back or Escape returns to the diagram. Edit holds the clipboard, delete, alignment, line style, layout and New diagram, View the zoom, the light or dark theme and the language. While a diagram is open, a last tab for its kind holds its elements and relationships.
- Model, the panel on the left: the model tree. Clicking a diagram opens it; clicking an element selects it.
- Canvas, in the middle: the open diagram.
- Properties, the panel on the right: everything about what is selected, such as its name, its attributes or the color of its box.
The canvas sits between the two panels. Drag a panel's inner edge to make it wider or narrower.
Moving around the canvas: the mouse wheel scrolls, Ctrl+wheel (or two fingers on a touchpad) zooms, and holding the middle or right mouse button down pans. The zoom box at the bottom has a button that fits the whole diagram into the window (Ctrl+Shift+0).
A look at the sample project
File › New › Sample project opens a finished project, a bike rental called Velo, with a diagram of every kind. It opens with the class diagram Domain model. Click through the diagrams in the model tree. Then try the idea above:
- Click the class
Stationon Domain model. The properties panel shows it. - Open the diagram Saturday, 9:12 in the package rental. It shows objects, among them
central : Station: an object of that very class, with a slot for each of its attributes. - Go back to Domain model and rename
StationtoHub(double-click its name). On Saturday, 9:12 the object now readscentral : Hub. Give the class another attribute, and the object gets a slot for it. - Undo with Ctrl+Z.
Your first diagram
- File › New › Blank project (Ctrl+N). A new project is empty, without a diagram.
- Edit › New diagram › Class diagram. The ribbon now has a tab Class diagram with its tools, and the model tree shows the new diagram.
- Choose Class in the ribbon and click into the diagram. The new class opens its name for typing: type
Customerand press Enter. - Add a second class
Orderthe same way. - Attributes and operations: double-click below the members of a class, or right-click it and choose Add attribute or Add operation. Type them as UML writes them:
- name : Stringor+ total() : int. Enter opens the next row; Escape stops. - A relationship: hover over
Customer. An arrow handle appears beside it; drag it ontoOrderand choose Association from the menu. Alternatively choose a relationship tool in the ribbon, such as Association, and drag from one class to the other. Double-click near an end of the line to give it a role name or a multiplicity such as0..*. - Save with Ctrl+S. UmlCraft projects are
.ucraftfiles.
Now look at the model tree: Customer, Order, their attributes and the association are all there, next to the diagram.
The same class on a second diagram
- Edit › New diagram › Class diagram again.
- Drag
Customerfrom the model tree onto the new diagram, thenOrder. The association comes along by itself, because it exists between the two classes in the model. - Rename
OrdertoPurchaseon this diagram (double-click its name), then open the first diagram: it saysPurchasetoo. - Select
Customerand press Ctrl+Delete (Remove from diagram). It is gone from this diagram, but still in the model tree and on the first diagram. - Select
Purchaseand press Delete. It is gone from both diagrams and from the model tree, with the association. Press Ctrl+Z to bring it back.
The same holds for every diagram kind: use cases and actors, states, activities, components, lifelines. Each kind has its own tab in the ribbon with the elements and relationships that make sense for it.
Letting UmlCraft do the layout
You do not have to place every box and bend every line by hand.
- Arrange automatically (Ctrl+Shift+L) lays out the whole diagram, or only what is selected. Its menu offers top to bottom or left to right.
- Route lines (Ctrl+Shift+R) leads lines around the boxes at right angles.
- New lines are routed for you and follow when you move their boxes, until you bend one by hand.
Getting it out of UmlCraft
- File › Export › Diagram as SVG or Diagram as PNG writes the open diagram as an image.
- Edit › Copy as image (Ctrl+Shift+C) copies the diagram to the clipboard: Word and PowerPoint paste it as a vector image, other programs as a picture.
Keys worth knowing
| Key | What it does |
|---|---|
| Ctrl+N, Ctrl+O, Ctrl+S | New project, open, save |
| Ctrl+Z, Ctrl+Y | Undo, redo |
| Delete | Delete the selection from the model |
| Ctrl+Delete | Remove the selection from this diagram only |
| Ctrl+C, Ctrl+X, Ctrl+V | Copy, cut, paste as new elements |
| Ctrl+Shift+V | Paste the same elements, for instance onto another diagram |
| Ctrl+Shift+L | Arrange automatically |
| Ctrl+Shift+R | Route lines |
| Ctrl+0, Ctrl+Shift+0 | Zoom to 100 %, fit the diagram |
| Ctrl+Shift+C | Copy the diagram as an image |
| Ctrl+, | Settings |
On macOS, Cmd takes the place of Ctrl.
Where to go next
- The other diagram kinds: Edit › New diagram lists them all. The sample project shows an example of each.
- Structograms (Nassi-Shneiderman diagrams): Edit › New diagram › Structogram.
- Source code: File › Import › Source code reads Java, C#, C++ or Python into the model, from single files or a whole folder. That gives you classes in the model tree but no diagram yet: drag them onto one.
- The README describes everything UmlCraft can do.
Erste Schritte mit UmlCraft
Diese Anleitung ist für dich, wenn du UmlCraft oder ein UML-Werkzeug dieser Art noch nicht kennst. Sie dauert etwa eine Viertelstunde. Was UmlCraft insgesamt kann, steht im README (auf Englisch).
Der eine Gedanke, den du zuerst verstehen solltest
UmlCraft sieht aus wie ein Zeichenprogramm, ist aber keins. Ein Zeichenprogramm merkt sich Formen: einen Kasten mit etwas Text darin, eine Linie zwischen zwei Kästen. UmlCraft merkt sich ein Modell: die Klassen, Akteure, Zustände und anderen Elemente dessen, was du beschreibst, und die Beziehungen zwischen ihnen. Ein Diagramm ist eine Ansicht auf einen Teil dieses Modells.
Denk an die Menschen in einem Fotoalbum. Jeden Menschen gibt es einmal; jedes Foto zeigt einige von ihnen. Derselbe Mensch kann auf vielen Fotos sein. Schneidest du ihn aus einem Foto heraus, verschwindet er nicht von den anderen und schon gar nicht aus der Welt.
In UmlCraft heißt das:
- Eine Klasse
Kundegibt es einmal im Modell, egal wie viele Diagramme sie zeigen. - Jedes Diagramm, das
Kundezeigt, zeigt dieselbe Klasse. Benennst du sie auf einem Diagramm um oder gibst ihr ein Attribut, zeigen alle anderen Diagramme die Änderung. - Eine Linie zwischen zwei Klassen ist eine Beziehung im Modell, nicht bloß ein Strich. Sie gehört zu den beiden Klassen, nicht zur Zeichnung.
- Der Modellbaum links listet alles auf, was das Modell enthält, auch das, was kein Diagramm zeigt. Er ist der eigentliche Inhalt deines Projekts; die Diagramme sind Ansichten darauf.
Die Frage „Was ist auf meinem Diagramm?“ hat also zwei Teile: was es im Modell gibt, und was davon dieses Diagramm zeigt, wo und wie.
| Was du willst | Im Zeichenprogramm | In UmlCraft |
|---|---|---|
| Eine Klasse auf einem zweiten Diagramm zeigen | Kasten kopieren und einfügen | Die Klasse aus dem Modellbaum aufs Diagramm ziehen, oder kopieren und mit Strg+Umschalt+V einfügen |
| Eine Klasse überall umbenennen | Jeden Kasten ändern | Einmal umbenennen |
| Einen Kasten von einem Diagramm nehmen | Löschen | Aus dem Diagramm entfernen (Strg+Entf): Sie bleibt im Modell und auf anderen Diagrammen |
| Eine Klasse ganz loswerden | Auf jeder Seite löschen | Aus dem Modell löschen (Entf): Sie verschwindet von allen Diagrammen, mit ihren Linien |
| Eine zweite, eigenständige Klasse anlegen | Kopieren und einfügen | Kopieren und einfügen (Strg+C, Strg+V): Die Kopie ist ein neues Element |
Löschen und Aus dem Diagramm entfernen sind die beiden Befehle, die du dir merken solltest. Die Entf-Taste löscht aus dem Modell. Wolltest du nur ein Diagramm aufräumen, drück Strg+Z und nimm stattdessen Strg+Entf. Jede Änderung lässt sich rückgängig machen.
Das Fenster
- Titelleiste, ganz oben: Speichern, Rückgängig, Wiederholen und der Name des Projekts, rechts „Über UmlCraft“ und die Einstellungen (das Zahnrad).
- Menüband darunter, mit seinen Registerkarten obenauf. Datei öffnet eine Seite über dem Fenster für Neu, Öffnen, Speichern, Import und Export; Zurück oder Escape führt zum Diagramm zurück. Bearbeiten hat Zwischenablage, Löschen, Ausrichten, Linienstil, Layout und Neues Diagramm, Ansicht den Zoom, das helle oder dunkle Design und die Sprache. Solange ein Diagramm offen ist, hat eine letzte Karte für seine Art dessen Elemente und Beziehungen.
- Modell, die Leiste links: der Modellbaum. Ein Klick auf ein Diagramm öffnet es, ein Klick auf ein Element wählt es aus.
- Zeichenfläche in der Mitte: das offene Diagramm.
- Eigenschaften, die Leiste rechts: alles über das Ausgewählte, etwa seinen Namen, seine Attribute oder die Farbe seines Kastens.
Die Zeichenfläche liegt zwischen den beiden Leisten. Ziehst du am inneren Rand einer Leiste, wird sie breiter oder schmaler.
Bewegen auf der Zeichenfläche: Das Mausrad scrollt, Strg+Mausrad (oder zwei Finger auf dem Touchpad) zoomt, und mit gedrückter mittlerer oder rechter Maustaste verschiebst du die Ansicht. Das Zoomfeld unten hat einen Knopf, der das ganze Diagramm ins Fenster einpasst (Strg+Umschalt+0).
Ein Blick ins Beispielprojekt
Datei › Neu › Beispielprojekt öffnet ein fertiges Projekt, einen Fahrradverleih namens Velo, mit einem Diagramm jeder Art. Es öffnet sich mit dem Klassendiagramm Domain model. Klick dich im Modellbaum durch die Diagramme. Dann probier den Gedanken von oben aus:
- Klick auf Domain model die Klasse
Stationan. Die Eigenschaften zeigen sie. - Öffne das Diagramm Saturday, 9:12 im Paket rental. Es zeigt Objekte, darunter
central : Station: ein Objekt genau dieser Klasse, mit einem Feld für jedes ihrer Attribute. - Geh zurück zu Domain model und benenne
StationinHubum (Doppelklick auf den Namen). Auf Saturday, 9:12 steht jetztcentral : Hub. Gib der Klasse ein weiteres Attribut, und das Objekt bekommt ein Feld dafür. - Mach alles mit Strg+Z rückgängig.
Dein erstes Diagramm
- Datei › Neu › Leeres Projekt (Strg+N). Ein neues Projekt ist leer, ohne Diagramm.
- Bearbeiten › Neues Diagramm › Klassendiagramm. Das Menüband hat jetzt eine Karte Klassendiagramm mit ihren Werkzeugen, und der Modellbaum zeigt das neue Diagramm.
- Wähl im Menüband Klasse und klick in das Diagramm. Die neue Klasse öffnet ihren Namen zum Tippen: Schreib
Kundeund drück Enter. - Leg auf dieselbe Weise eine zweite Klasse
Bestellungan. - Attribute und Operationen: Doppelklick unter die Einträge einer Klasse, oder Rechtsklick und Attribut hinzufügen bzw. Operation hinzufügen. Schreib sie, wie UML sie schreibt:
- name : Stringoder+ summe() : int. Enter öffnet die nächste Zeile, Escape hört auf. - Eine Beziehung: Fahr mit der Maus über
Kunde. Daneben erscheint ein Pfeil-Anfasser; zieh ihn aufBestellungund wähl im Menü Assoziation. Oder wähl im Menüband ein Beziehungswerkzeug wie Assoziation und zieh von einer Klasse zur anderen. Ein Doppelklick nahe einem Linienende gibt ihm einen Rollennamen oder eine Multiplizität wie0..*. - Speichern mit Strg+S. UmlCraft-Projekte sind
.ucraft-Dateien.
Sieh dir jetzt den Modellbaum an: Kunde, Bestellung, ihre Attribute und die Assoziation stehen alle dort, neben dem Diagramm.
Dieselbe Klasse auf einem zweiten Diagramm
- Noch einmal Bearbeiten › Neues Diagramm › Klassendiagramm.
- Zieh
Kundeaus dem Modellbaum auf das neue Diagramm, dannBestellung. Die Assoziation kommt von selbst mit, weil sie im Modell zwischen den beiden Klassen besteht. - Benenne
Bestellungauf diesem Diagramm inAuftragum (Doppelklick auf den Namen) und öffne dann das erste Diagramm: Dort steht auchAuftrag. - Wähl
Kundeaus und drück Strg+Entf (Aus dem Diagramm entfernen). Die Klasse ist von diesem Diagramm verschwunden, steht aber noch im Modellbaum und auf dem ersten Diagramm. - Wähl
Auftragaus und drück Entf. Die Klasse ist von beiden Diagrammen und aus dem Modellbaum verschwunden, mit der Assoziation. Strg+Z holt sie zurück.
So ist es bei jeder Diagrammart: Anwendungsfälle und Akteure, Zustände, Aktivitäten, Komponenten, Lebenslinien. Jede Art hat im Menüband eine eigene Karte mit den Elementen und Beziehungen, die zu ihr passen.
UmlCraft das Anordnen überlassen
Du musst nicht jeden Kasten selbst platzieren und jede Linie selbst knicken.
- Automatisch anordnen (Strg+Umschalt+L) ordnet das ganze Diagramm an, oder nur das Ausgewählte. Sein Menü bietet „Von oben nach unten“ und „Von links nach rechts“.
- Linien führen (Strg+Umschalt+R) führt Linien rechtwinklig um die Kästen herum.
- Neue Linien werden für dich geführt und folgen, wenn du ihre Kästen verschiebst, bis du eine selbst knickst.
Aus UmlCraft heraus
- Datei › Exportieren › Diagramm als SVG oder Diagramm als PNG schreibt das offene Diagramm als Bild.
- Bearbeiten › Als Bild kopieren (Strg+Umschalt+C) kopiert das Diagramm in die Zwischenablage: Word und PowerPoint fügen es als Vektorgrafik ein, andere Programme als Bild.
Tasten, die sich lohnen
| Taste | Was sie tut |
|---|---|
| Strg+N, Strg+O, Strg+S | Neues Projekt, öffnen, speichern |
| Strg+Z, Strg+Y | Rückgängig, wiederholen |
| Entf | Das Ausgewählte aus dem Modell löschen |
| Strg+Entf | Das Ausgewählte nur aus diesem Diagramm entfernen |
| Strg+C, Strg+X, Strg+V | Kopieren, ausschneiden, als neue Elemente einfügen |
| Strg+Umschalt+V | Dieselben Elemente einfügen, etwa auf ein anderes Diagramm |
| Strg+Umschalt+L | Automatisch anordnen |
| Strg+Umschalt+R | Linien führen |
| Strg+0, Strg+Umschalt+0 | Zoom auf 100 %, Diagramm einpassen |
| Strg+Umschalt+C | Diagramm als Bild kopieren |
| Strg+, | Einstellungen |
Auf dem Mac tritt Cmd an die Stelle von Strg.
Wie es weitergeht
- Die anderen Diagrammarten: Bearbeiten › Neues Diagramm listet sie alle. Das Beispielprojekt zeigt zu jeder ein Beispiel.
- Struktogramme (Nassi-Shneiderman-Diagramme): Bearbeiten › Neues Diagramm › Struktogramm.
- Quellcode: Datei › Importieren › Quellcode liest Java, C#, C++ oder Python ins Modell, aus einzelnen Dateien oder einem ganzen Ordner. Dann hast du Klassen im Modellbaum, aber noch kein Diagramm: Zieh sie auf eins.
- Das README beschreibt alles, was UmlCraft kann (auf Englisch).