Metamodel Extension

Diagram

A special node is the Diagram. It is the topmost GraphElement of any graph or diagram in this terminology and recursively contains all other GraphicElements. A Diagram has a name and a viewport. The viewport is a point which indicates the top left-hand corner of the current visible part of the Diagram. It also has a zoom factor, which allows it to be shown at a different scale. The type of the Diagram is stored in a SimpleSemanticModelElement, e.g. StateDiagram. The Diagram references it through its semanticModel.A graph element can be linked to diagrams via a DiagramLink. Such a link could be employed if a graph element can be represented by other diagrams, e.g. on a more detailed level or if the graph element has a special semantic relation to other diagrams. A DiagramLink has its own zoom factor and viewport, so each diagram can be displayed with a different zoom factor and viewport in each context. An example for the use of a diagram link is a state diagram which displays the behavior of a class or a class diagram, which displays details of a package.

A simple example of a Diagram is given through the object diagram in Figure 7. It shows a class diagram with two classes which are linked through an association. The diagram and the classes are represented through GraphNodes, while the association is represented by a GraphEdge. This object diagram also shows the role which GraphConnectors assume in linking GraphNodes and GraphEdges.