Viewing diagrams
The Diagrams view displays model elements and their references in a graphical way.
This view can be displayed using the Show Diagrams View contextual menu in the model editor,
or using the main menu Window > Show View > Diagrams.
Note: the Diagrams view requires the Graphical Editing Framework (GEF).
The Diagrams view displays diagram information based on the model element selected in the active model editor.
It is a multi-page view and there may be multiple diagrams available for a particular model element.
Diagrams may be contributed by a plugin developer. The platform provides two diagrams:
- ER (Entity / Relation): shows an horizontal tree of nodes, where the root is the model editor selected element.
Child nodes are the elements referenced by the root node. The default ER diagram shows all references.
The tree can be expanded to navigate through references from one element to another.
- Hierarchy: shows a vertical tree nodes, where the root is the model editor selected element.
Child nodes usually are elements referenced by the root node in terms of containment, restricted to a subset of references.
Constrained diagrams
ER and Hierarchy diagrams are constrained diagrams:
- The content is provided by the analysis of the elements and their references, as defined in the model.
- The layout is fixed, you can't move or hide nodes.
Free-form diagrams
Other diagrams may be provided by a metamodel administrator.
Such diagrams may be free-form diagrams:
- The content is still provided by the analysis of the elements and their references, as defined in the model.
However a palette is provided on the right side of the diagrams and allows to add new elements and connections in the diagram.
- You control the layout: you can move and resize nodes.
The toolbar of free-form diagrams provide the capability to customize the layout:
- Alignment: enables to align (top, left, etc.) nodes, in case of multiple node selection
- Size: enables to resize nodes to match a common width or height.
- Show Grid: enables to align nodes on a grid.
- Snap to Geometry: allows to quickly align nodes being dragged to other nodes in the diagram (showing blue feedback line during drag).
Custom Diagram templates
The ER and Hierarchy diagrams can be customized in a Preference page using the
main menu Window > Preferences and MDWorkbench > Models > Diagrams.
Using this Preference page, you may define additional templates for those diagrams.
To add a new diagram template, you must provide the follwing information:
- The name of the diagram template
- The metamodel this template applies to
- The types for which the diagram template is enabled.
The diagram template will be displayed in the Diagrams view when instances of such types are selected in the model editor.
- The features (attributes and references) to be displayed in the diagrams.
You may optionally provide other information
- Type contents retriction: instances of such types will be ignored and won't be displayed in the diagram.
- Hide relation names: toogle the display of relation names in the diagram.
- Expand to level (Hierarchy diagram only): automatically expands the diagram tree to the specified level.
A diagram template can then be selected using the Diagrams view toolbar.
Browsing a model
Using the Properties view