Java Reference
In-Depth Information
definitions for basic, class diagram, and state machine diagram elements. Of
course, the UML2 Tools project provides an extensive set of additional example
GMF models.
In most cases, you can define custom elements for a graphical definition and
specify any existing classes that you developed previously using GEF. Or you
might want to code certain figures by hand and reference them in your graphical
definition model. You can also use this capability when generating standalone
figure plug-ins; the produced mirrored.gmfgraph model will contain refer-
ences to custom elements generated from the original graphical definition model.
Section 4.5.5, “Generating the Figures Plug-In,” illustrates the technique of using
a standalone figure plug-in.
11.1.1 The Canvas
At the root of every graphical definition model is the Canvas . This root element
has a name property and containment references to one or more Figure
Galleries , Nodes , Connections , Compartments , and Labels . Note the dis-
tinction between figures and diagram elements. In a GMF graphical definition, a
Figure is defined within a Figure Gallery , which is then referenced by Node ,
Connections , Compartment , and Label diagram elements, via Figure
Descriptors and Accessors . These diagram elements are siblings to Figure
Gallery elements, although they can reference figure definitions from other
graphical definition models. The idea is to promote reuse of figure definitions
without adding the complexity of yet another GMF model.
11.1.2 The Figure Gallery
As mentioned, a Canvas can contain a number of Figure Gallery elements,
which, in turn, contain figures, figure descriptors, and an optional implementa-
tion bundle property.
TIP
Be careful not to name your Canvas the same as any of the contained
Figure Gallery elements because this will cause a name clash.This will
be detected during validation of the graphical definition model, but it will
result in exceptions when trying to load the Canvas mapping in the
 
Search WWH ::




Custom Search