Metamodel Extension

Diagram

The Namespace of a Diagram

In general, a UML Element is assigned to a UML Namespace while a DiagramElement is not. A DiagramElement does not need a namespace as long its SemanticModelBridge (see below) references a UML Element which has one. If this is not the case, a surrounding GraphElement serving as container will have a namespace. However, there is an exception to this rule. The Diagram does not have a namespace and there is no GraphElement containing it because the Diagram itself is the topmost container.

Therefore, the Diagram is in need of a namespace. The namespace of the Diagram is assigned by the reference of a namespace element of the semantic model via the SemanticModelBridge. The Element referenced by this way from the diagram must be a subclass of Namespace.

Showing a cut-out of a Diagram in another Diagram

A Diagram may be used to show an extract of an existing Diagram without the need of creating the used DiagramElements more often than once. For example, a large Diagram may be shown through several smaller Diagrams for a better representation. To achieve this, the large Diagram would own all its containing DiagramElements while the cut-out Diagrams would only contain References to the original DiagramElements. Only those DiagramElements are shown in a cut-out Diagram which are being pointed to by a Reference. References and stand-alone DiagramElements may be used independently in the same diagram.

Visibility of Diagram Elements

The attribute visible specifies whether a DiagramElement is being shown or not. Its value is applied recursively to all contained DiagramElements. If only one DiagramElement in the hierarchy has set its visible attribute to false, all nested elements are also hidden, regardless of their own visibility.

While a hidden element is not shown, it still exists. This means that if it is shown by setting visible to true, the element appears in the same way as before. This provides a comfortable way to fade out a compartment, for example, while keeping its representation. This makes it easy to show a previously hidden DiagramElement again later.