Metamodel Extension

Coordinate system

The coordinate system used in the diagram interchange extension defines that the x-axis points to the east and the y-axis to the south. Position and size are defined through double values which employ pixels as the unit of measurement. The floating point type double allows sub-pixel accuracy. This prevents a possible loss of information when exchanging scaled or otherwise manipulated diagrams.

Position

Generally speaking, all position values used in this model are relative, i.e. any position value of a GraphElement is relative to its surrounding container. This means that the container's position is the origin for any child's position. To obtain the absolute position of a DiagramElement, it is necessary to navigate recursively through the container GraphElement until a GraphElement with no container, the root, is encountered. This root node must be a Diagram since it is only Diagrams that do not have a container.

The position of a GraphElement is specified through the StructureType point. This indicates the top left-hand corner of a GraphNode or Diagram. The x and y coordinates of a position are allowed to be negative.

For a GraphEdge, the position serves as an origin for all the DiagramElements contained. Since a GraphEdge is defined through its waypoints, position does not affect the graphical representation of the GraphEdge itself. It is drawn as a Bezier curve through all of its waypoints, which are of type BezierPoint. The control points are defined relative to base. Thus, if all control points are zero (0, 0), the result is a simple polygon line.

A Diagram does not need to have a surrounding container element. Its position is (0, 0) by default. The viewport specifies the top left-hand coordinate of a currently shown view within the Diagram. The viewport is different from (0, 0) if the view has been scrolled.

The relative coordinates allow hierarchies of nested nodes to be moved easily by changing the position of the root node. For example, moving a class can be done by changing the position of the GraphNode representing it. All the GraphElements contained automatically move with the class since they are positioned relative to it.