Norwegian University of Science and Technology

Global navigation

Diagram editing

The tools in the palette (see figure) support direct manipulation editing of the diagram in the diagram pane. There is a large set of creation tools, i.e. tools for creating new elements, as well as the generic selection tool and a specialised (and useful) gesture tool.

The selection tool

The selection tool, shown as an arrow pointer in the palette, is used for (you guessed it) selection elements. The selected elements will be decorated with handles, that support further direct manipulation of the elements' visual properties, like position and size, with some variations. E.g. gates may not be resized, but just moved along the edge of an interactor, and computations may be rotated, in addition to moved and resized.

The selection tool, may also be used for semantic actions, like deleting elements or moving elements in the interactor hierarchy. E.g. dragging and dropping a variable across an interactor boundary, changes its parent interactor to the target interactor. The target will be highlighted to indicate what is about to happen.

Basic element creation tools

Basic element creation tools are provided for creating all the language constructs. The node-like constructs are created by selecting the tool and dragging out the bounding box, while the edge-like constructs are created by dragging from the source node to the target node. Feedback is provided to prevent placing a construct in the wrong context, e.g. a computation in a variable or a connection from or to a state.

In addition to the basic creation tools, there are two other means for creating elements, the gesture tool and the model fragment insertion tools.

The gesture tool

The gesture tool, shown as a pen in the palette, is used for quickly performing common editing actions, by drawing suggestive shapes instead of selecting specific tools and dragging. To create a variable, draw a rectangle, to create an interactor, draw a left bracket (rectangle without the right side) and to create a computation, draw a triangle. Connections may be drawn by just drawing a line from the source element to the target element. If a gesture is not recognized, the element underneath the gesture is selected. A gesture starting on a handle or bounding box is interpreted as a mouse drag, and hence may be used to resize or move an element (or whatever the handle is used for).
Tools palette

The model fragment insertion tools

The model fragment insertion tools are used to create or insert pre-defined model-fragments to save editing. This is typically used to create interactors with common gates and widget content, e.g. a String interactor with String output-receive and input-send gates and containing a Text widget. To create the model fragment, just drag out the fragment's bounding box, and the fragment is inserted and resized accordingly. If the bounding box is too small, a default is used. Model fragments may also be inserted by dragging and dropping the tool itself. <p/>The model fragment insertion tools are located in palette folders based on their category: Devices (interactors with gates but no content), widget interactors (interactors with gates and containing widgets), widgets and composites (several connected interactors). The set of categories and the corresponding model fragments are contained in a template diagram (nothing special, just a normal Diamodl diagram used in a special way) and configured in the custom diamodl editor's plugin.xml.

2007/11/06 00:54, Hallvard Trætteberg
NTNU, NO-7491 Trondheim. Telephone: +47 73 59 50 00. Contact us
Editorial responsibility: