Java Reference
In-Depth Information
Reference element. By specifying both, the generated code knows both where
to store newly created elements and where to retrieve existing elements.
11.3.3 Node Mapping
Each Top Node Reference and Child Reference contains a single Node
Mapping . A Node Mapping element binds a Diagram Node , Tool , and domain
model Element together. A number of properties and child elements are avail-
able to a Node mapping, so let's start with the basics.
The domain Element is the EClass from the domain model that this node
mapping represents. Likewise, the Diagram Node is the node from the graphi-
cal definition used to display the graphical concrete syntax for this node. Finally,
the Tool is the creation tool from the tooling definition that is used to create the
node from the palette. As you might have predicted, GMF does not yet use the
Appearance Style and Context Menu .
TIP
You can assign the same palette tool to multiple nodes. This results in a
pop-up menu of the mapped nodes appearing when you use the tool, giv-
ing you the choice to select the proper element. It's not clear whether this
is a better approach than using multiple palette tools, particularly consid-
ering that they can be stacked. When constraints are applied to each ele-
ment that the tool can create so that no ambiguity exists for the target, no
pop-up will appear when only one possibility exists, as was the case in the
scenario diagram.
The Related Diagrams element maps to a Canvas Mapping so that this
diagram node can be used to navigate to another diagram. This concept is known
as diagram partitioning. It's rather straightforward to use this feature to create
partitioned diagrams, or diagrams where a node maps to its own Canvas and
thereby allows composite domain elements to be displayed on their own Canvas .
For example, consider an Ecore or Unified Modeling Language (UML) diagram
in which the package element is represented as a Canvas and can be created in
a hierarchy. A package node is related to the diagram's Canvas ; by default,
double-clicking on a package opens a new diagram surface. The UML2 Tools
 
Search WWH ::




Custom Search