Java Reference
In-Depth Information
source
reference and the
Target Feature
to the
target
feature. Also ensure
that the proper Tool and Diagram Link are selected. Upon
Finish
, browse the
mapping model in the editor. Check each property to verify that all are correct,
and use the
Validate
action from the context menu.
Regarding our two types of links, notice that they illustrate the two most
common methods of providing link mappings for a diagram. The subtopics ref-
erence maps to a link that shows the relationship between
Topic
elements. In
this case, we need to indicate only the
Target Feature
in our link mapping,
leaving the other properties blank. The relationship link shows how to map a
link to a domain model class—in this case, our
Relationship
class. To com-
plete the mapping definition, we need to specify the
Element
and its
Contain-
ment Feature
,
Source Feature
, and
Target Feature
for the link.
Let's go through the mapping model in some detail, because it often causes
confusion. Beginning with the
Canvas Mapping
element, you can see that the
Map
domain
Element
will be represented by the mindmap
Diagram Canvas
from our
mindmap.gmfgraph
model. Similarly, the diagram canvas will have a
Palette
, represented by our
mindmap.gmftool
model's
mindmapPalette
element. Note that the
Menu
and
Toolbar Contributions
properties are
blank because GMF has not yet implemented them, as seen in Table 4-1.
Table 4-1
Mindmap Canvas Mapping
Element
Property
Value
Mapping
Canvas
Domain Model
Mindmap
Element
Map
Palette
Palette mindmapPalette
Diagram Canvas
Canvas mindmap
For our
Topic
node, we see in the properties of the
Top Node Reference
that new instances of
Topic
elements are to be maintained in the
elements
con-
tainment reference of our
Map
class, as shown in Table 4-2. The
Children
Feature
property is left blank because we retrieve and store our
Topic
elements directly from the
elements
containment feature.
Search WWH ::
Custom Search