Diagram Editor
Table of Contents
Overview
Actifsource offers graphical editors to view and edit the meta-model and model. For editing the model it is possible to define domain-specific editors.
Class Diagram Editor
The class diagram editor allows you to create new meta-models based on Actifsource classes.
New Class Diagram
You can create a new class diagram via context menu in the project explorer or File/New.
Preselecting a package will directly fill in the resource path and package in the wizard.
Palette
Use the palette to edit your diagram.
-
Select Selects one or many classes from the diagram. Use Ctrl+Click for multi select.
-
Marquee Selects classes from the diagram within a rectangle.
-
Extension Derives a class from another class by adding a Class.extend statement in the sub class.
Inserting an extends-relation from MySubClass to MyClass would add an extends-relation from MySubClass to MyClass as expected. At the same time the extends-relation from MySubSubClass to NamedResource is removed because MyClass already extends NamedResource.
The same rule also applies when extending from Resource.
Note that are special rules for your convenience. Consider creating two new Classes MyClass and MySubClass Both are extending NamedResource by default.
- Relation Inserts a relation from a class to another. Select one of the relation types or a base relation. Selecting a base relation automatically selects the relation type needed (see Chapter Property).
- Note Connects class to any note. See also New Note.
- New Class Inserts a new class on the diagram and in the model. Note that the preselected namespace (package and/or containing resource) is the same as the package of the class diagram.
Note that you can directly select the super class in this dialog. While NamedResource is the default you may select**Resource** to create an unnamed resource, or any other Class. For other properties see also Chapter 4.6.1 ch.actifsource.core.Class.
- New Enum Inserts a new enum on the diagram and in the model. For other properties see also Chapter 4.6.2 ch.actifsource.core.Enum.
- New Note Inserts a new note on the diagram. Click on the first text line of the note to enter the edit mode.
Drag and Drop
Use the drag and drop feature from the project explorer to add an existing class to your diagram.
Context Menu
Use the context menu on the diagram background.
- Show Shows any existing resource in the scope of your project. Use this feature to insert resources from third party or Actifsource models to your diagram (i.e. Actifsource Core Model).
Class Context Menu
Use the content menu on any class.
- Delete from Diagram Deletes this class from the diagram only but not from the model. Use Delete on the keyboard to delete selected classes from the diagram.
- Delete from Model Deletes this class from the diagram and from the model. Use Shift+Delete on the keyboard to delete selected classes from the diagram and from the model.
- Show Attributes Shows attributes (literals) in an UML-like style.
-
Hide Attributes Hides shown attribute (see also Show Attributes).
-
Instances Inserts instances of a specific class on the diagram.
-
Types Shows the types (Class.typeOf statement) of a specific class.
-
Super Class Shows the superclass (Class.extend statement) of a specific class. You this feature repeatedly to show the inheritance hierarchy.
Browse Resource
Open any class in the resource editor by Ctrl+Click on the class name.
Domain Diagram Editor
The domain diagram editor allows you to create new models based on your meta-model.
New Domain Diagram
You can create a new class diagram via context menu in the project explorer or File/New.
Preselecting a package will directly fill in the resource path and package in the wizard.
- Name The name of the domain diagram.
- Diagram Type Every domain uses its own diagram styles. The DiagramType lets you define your domain-specific domain diagrams (see Chapter 6 Domain Diagram Type).
If there is no diagram type defined, the diagram editor has a default behavior and shows resources and their relationships (use and own relation, dependencies).
As a very simple example, let us define a diagram type for a state machine meta-model.
As the root class (see also Single Root) we choose Statemachine. This means that we can only edit elements that are part of the state machine.
The allowed class is State since we like to edit states. Between states there are transitions. A Transition is an indirect relation from State via Transition to State.
The minimal diagram type shown above leads to a domain specific state event diagram.
- SingleRoot If there is a single root defined, every resource is created in the context of the single root. If no single root is defined, resources are created in the same package as the domain diagram.
Note that defining a rootClass in the DiagramType demands for a singleRoot in the domain diagram.
New Domain Diagram for Resource
You can create a new domain diagram for a single root directly by calling New/Domain Diagram on a resource.
Note that the single root is preselected in the wizard and the diagram type is automatically detected if there is a diagram type which has a root class of the same type as the chosen single root.
Palette
Use the palette to edit the domain diagram.
- Select Selects one or many classes from the diagram. Use Ctrl+Click for multi select.
- Edit Edits figures with a FigureEditableLabelSelector.
Note that you can also enter the edit mode with the Select tool. Click on the text to alter – wait for one second until the cursor changes to text mode – and click again.
- Marquee Selects classes from the diagram within a rectangle.
- Relation Inserts a relation from a resource to another.
- Resources Inserts a new resource on the diagram and in the model.
- Search Searches allowed classes with a defined search path.\
Drag and Drop
Use the drag and drop feature from the project explorer to add an existing resource to your diagram.
Context Menu
-
Delete from Model Deletes this resource from the diagram and from the model. Use Shift+Delete on the keyboard to delete selected resources from the diagram and from the model.
-
Hide Resource Deletes this resource from the diagram but not from the model. Use Delete on the keyboard to hide selected resources from the diagram.
-
Show Resource Shows any hidden resource in the scope of the selected resource. If this action is called on the background of the diagram, the scope is your single root.
-
Show/Hide Resource Part Shows or hides aggregated parts (see Chapter 4.4.5 Composition).
-
Router Selects between different routing algorithms.\
Router Description Image Default Manual routing by dragging Manhatten Lines are routed with 90° NoIntersection As few intersections as
Browse Resource
Open any class in the resource editor by Ctrl+Click on the class name.
Browse Diagram
Actifsource automatically detects resources that are also shown on other diagrams. Simply click on the diagram symbol to list and browse the other diagrams.