Java Reference
In-Depth Information
Table 4-2
Mindmap Topic Mapping
Element
Property
Value
Mapping
Top Node Reference
Containment Feature
Map.elements : MapElement
Node Mapping
Element
Topic -> MapElement
Diagram Node
Node Topic (TopicFigure)
Tool
Creation Tool Topic
Feature Label Mapping
Diagram Label
Diagram Label TopicName
Features
MapElement.name : EString
Below the Top Node Reference mapping is the Node Mapping for the
Topic class itself. The Topic class, which is a subclass of MapElement , is used
for the node's Element . The Topic node from our mindmap.gmfgraph is used
for the Diagram Node , which we see references the TopicFigure from the
Figure Gallery . Finally, the Node requires a Tool , so we select the Topic
Creation Tool from our palette defined in our mindmap.gmftool model.
Note that the Appearance Style and Context Menu properties are left blank
because GMF has not yet implemented them.
The Topic displays its name using a label, which is defined in the child
Feature Label Mapping element. The Diagram Label property is selected
to the TopicName label in our graphical definition and displays the value of the
Topic 's name:EString attribute. Both the Edit and View Method properties
are set to the default MESSAGE_FORMAT value, meaning that the Java
MessageFormat class provides the underlying implementation for parsing, edit-
ing, and displaying our label. In the case of our Topic label, a single attribute is
displayed, with no other characters required.
With the node mapping complete, let's look at the subtopics link mapping.
In our domain model, Topic s are related to other “sub” Topic s using the
subtopics reference. Simple references such as this are straightforward to map in
GMF because we only need to set our Target Feature property to this refer-
ence in our domain model, as seen in Table 4-3. Our next link mapping discusses
the remaining Domain meta information properties. The Diagram Link
and Tool properties are set as you would expect, to the TopicSubtopics
Connection from our graphical definition, and to the TopicSubtopics
Creation Tool in our tooling definition, respectively.
Search WWH ::




Custom Search