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.

image114 image114

Preselecting a package will directly fill in the resource path and package in the wizard.

image115 image115

Palette

Use the palette to edit your diagram.

image116 image116

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

    image117 image117

    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.

Info

Note that are special rules for your convenience. Consider creating two new Classes MyClass and MySubClass Both are extending NamedResource by default.

image118 image118

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

image119 image119

  • 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.
Info

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.

image120 image120

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

image121 image121

Drag and Drop

Use the drag and drop feature from the project explorer to add an existing class to your diagram.

image122 image122

Context Menu

Use the context menu on the diagram background.

image123 image123

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

image124 image124

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

image125 image125

  • Hide Attributes Hides shown attribute (see also Show Attributes).

  • Instances Inserts instances of a specific class on the diagram.

    image126 image126

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

image127 image127

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.

image128 image128

Preselecting a package will directly fill in the resource path and package in the wizard.

image129 image129

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

image130 image130

As a very simple example, let us define a diagram type for a state machine meta-model.

image131 image131

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.

image132 image132

The minimal diagram type shown above leads to a domain specific state event diagram.

image133 image133

  • 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.
Info

Note that defining a rootClass in the DiagramType demands for a singleRoot in the domain diagram.

New Domain Diagram for Resource

image134 image134

You can create a new domain diagram for a single root directly by calling New/Domain Diagram on a resource.

image135 image135

Info

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.

image136 image136

  • Select Selects one or many classes from the diagram. Use Ctrl+Click for multi select.
  • Edit Edits figures with a FigureEditableLabelSelector.
Info

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

Note that you control the palette by AllowedClass.paletteEntry in your diagram type. image137 image137

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

image138 image138

Context Menu

image139 image139

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

    image140 image140

    image141 image141

  • Router Selects between different routing algorithms.\

    Router Description Image
    Default Manual routing by dragging image142 image142
    Manhatten Lines are routed with 90° image143 image143
    NoIntersection As few intersections as image144 image144

Browse Resource

Open any class in the resource editor by Ctrl+Click on the class name.

image145 image145

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.

image146 image146