Java Reference
In-Depth Information
picture that needs to be synchronized, so it's recommended that you first define
all your figures and generate the plug-in that contains the associated
mirror.gmfgraph model. The mapping model uses the mirrored model instead
of the original graphical definition model. With this approach, the mapping
model passes class name references to the generator model, not actual classes.
The generated code simply references the figure classes in their own plug-in and
is not written out as inner classes within generated edit parts. This process
imposes the additional step of regenerating the figures and mirrored model upon
a change to the graphical definition. A future version of GMF will hopefully do
away with the serialized class method and make generating a standalone figures
plug-in work more seamlessly in the workflow.
To ease the design of figures, a WYSIWYG (what you see is what you get)
style of editor is included in the experimental Software Development Kit (SDK).
It is not complete, but it illustrates the bootstrapping of GMF and a method for
customization using a decorator model described in detail in Section 4.2.3,
“Dynamic Templates.” Use of the graphical model editor is also helpful for
understanding layouts and how they work when composing complex figures.
Tooling Definition Model
Diagrams typically include a palette and other periphery to create and work with
diagram content. The purpose of the tooling definition model is to specify these
elements. The tooling model currently includes elements for the palette, the tool-
bar, and various menus to be defined for a diagram. Unfortunately, in the current
release of GMF, the generator uses only the palette element. If additional capa-
bilities are required until this functionality is completed, advanced properties
view UI elements can be designed using an extension to the generator model and
custom templates, as discussed in Section 4.6.6, “Color Preferences.” Note that
it is also possible to exclude the palette altogether from a diagram definition,
thereby creating a read-only diagram. Of course, the pop-up bars and connection
handles features should be disabled as well in this case.
Mapping Model
Perhaps the most important of all models in GMF is the mapping model. Here,
elements from the diagram definition (nodes and links) are mapped to the
domain model and assigned tooling elements. The mapping model represents the
actual diagram definition and is used to create a generator model. Typically a
one-to-one mapping exists among a mapping model, its generator model, and a
particular diagram.
The mapping model uses Object Constraint Language (OCL) in many ways,
including initializing features for created elements, defining link and node
Search WWH ::




Custom Search