Java Reference
In-Depth Information
an existing template if found in the same namespace, effectively merging its
content with the original. Sections 4.6.5, “Gradient Figures,” and 4.6.6, “Color
Preferences,” describe the use of custom templates with GMF in detail.
Decorator Model
A more advanced—and possibly most conceptually “pure”—method for cus-
tomizing or extending the output of GMF code generators is to use a decorator
model. Basically, the GMF generator model is wrapped in a root XML Metadata
Interchange (XMI) element to allow additional decorator model instances to
coexist and to enable elements of the generator model to reference them. Xpand
templates used to generate diagram code are augmented with custom templates
that are invoked when these references are encountered.
The GMF graphical definition model has a bootstrapped diagram editor to
allow for WYSIWYG-style figure development. It was implemented using cus-
tom templates and also includes a decorator model for use in defining its form-
based properties view. This serves as an example of how to use decorator models
in the context of GMF, but also for any other occasion in the context of using a
DSL Toolkit where extensions are required to an existing model used for gener-
ation. Section 4.6.6, “Color Preferences,” covers the steps in using decorating
models in GMF.
Model Extension
With the addition of the child extenders feature in EMF 2.4, it's possible to have
your contributed model elements of customizations to the GMF models available
in the default editor. GMF 2.1 has been regenerated with these generator model
settings, thereby allowing your extensions to contribute to GMF editors. The
UML2 Tools project has extensions defined for GMF models and makes use of
this new capability.
4.2.4 Dashboard
GMF comes with a dashboard view that streamlines the workflow of dealing
with its collection of models. The dashboard is available from Window
Show
View
gmfd), or you can open
it when creating a new GMF project. Figure 4-2 shows the dashboard used in the
context of the mindmap diagram sample project.
Other
General
GMF Dashboard (Ctrl+3
Search WWH ::




Custom Search