Java Reference
In-Depth Information
Figure 10-53
Basic mindmap diagram
10.8.4 Comparison to Generated Diagram
Now that we've manually created a diagram using the GMF runtime, let's com-
pare the result with what the tooling component of GMF is generating. If we
define a simple mindmap graphical, tooling, mapping, and generator model (see
Section 4.3.4, “Mindmap Generator Model”), we can observe what is generated
with what was created above by hand. Note that what's described below is only
for a simple mapping of the Topic element to a node, subtopics relationship
mapped to a link, and topic name label. No advanced options (such as printing
support, shortcuts, audits, metrics, and so on) were selected, which would cause
even more to be generated.
The generated diagram contributes extensions to a number of runtime exten-
sion-points, including contributionItemProviders , globalAction
HandlerProviders , iconProviders , parserProviders , viewProviders ,
editpartProviders , elementTypes , elementTypeBindings , and
modelingAssistantProviders . Notably missing are the editpolicy
Providers and paletteProviders contributions. The tooling team did not
think these were necessary, opting instead to add generated EditPolicy contri-
butions directly in EditPart s and generating a PaletteFactory implementa-
tion from the gmftool model directly. Figure 10-54 shows the runtime
extension-points contributed to by the initial mindmap diagram defined in
Chapter 4.
In addition to providing labels with parser providers for in-place editing, the
generated diagram provides diagram preferences, generic navigator support, link
reorientation commands, diagram initialization from an existing domain model
instance, a diagram update command, and several other features. For larger dia-
grams with many domain elements and diagram representation, clearly, begin-
ning with the tooling models and generating the base implementation is the
Search WWH ::




Custom Search