Java Reference
In-Depth Information
Table 4-4
Mindmap Relationship Link Mapping (continued)
Element
Property
Value
Feature Label Mapping
Diagram Label
Diagram Label RelationshipType
Features
Relationship.type : Type
Read Only
true
View Pattern
«{0}»
The graphical wizard created child label figures for our relationship link, but
the mapping wizard does not provide label link mappings. We need to add these
manually before proceeding. Create a new child Feature Label Mapping to
the Relationship Link Mapping and fill in accordingly, for the Relationship
name attribute.
Add another Feature Label Mapping to the link, but this time set it to
Read Only and alter the View Pattern to add <<guillemets>> to the type
name. With the basics of our initial diagram mapping understood, we're ready
to move on to generation.
4.3.4 Mindmap Generator Model
The last model to create in developing our mindmap diagram is the GMF gener-
ator model. As mentioned, this model is analogous to the EMF genmodel and
contains additional parameters used for generating our diagram plug-in.
Technically, the GMF generator model is a bit more complex and is really the
result of a many-to-one model transformation. To produce our mindmap.
gmfgen model from our mindmap.gmfmap model, right-click the mapping
model and select Create Generator Model to open the wizard. The default name
and location are fine, as is the selection of the mapping model. The
mindmap.genmodel should also be selected by default but could indicate a
warning about the relative date of the genmodel to its ecore model. If required,
reload the genmodel at this time; GMF utilizes references found there for its own
code generation. On the last page of the wizard, leave the defaults as is and click
Finish to complete.
Open the new mindmap.gmfgen model in the editor so we can adjust a cou-
ple of its properties prior to generation. In the Gen Editor Generator prop-
erties, set the Diagram File Extension to mmd in place of the default
mindmap_diagram , as seen in Figure 4-6. Also, we select true for the Same
File For Diagram and Model property. The default behavior persists them
into separate files, which we consider for other diagrams.
Search WWH ::




Custom Search