Java Reference
In-Depth Information
Figure 10-20
Diagram rulers and grid preferences
Used by the runtime to manage diagram element, position, and style attributes,
the notation model also allows for persistence of diagrams to the file system. The
notation model provides the link between GEF and EMF, and the GMF dia-
gramming functionality is based on this model. Although it is general in its
design, the notation model borrows some from GEF itself, similar to the tooling's
graphical definition model.
Figure 10-21 is a diagram of the notation model. As you can see, the
View
class has an element reference to
EObject
. This is how the runtime provides a
link to the domain model (or “semantic” model, as it's commonly referred to in
the runtime documentation).
EditPart
s will find their model element using this
reference, although indirectly because the
View
object will be the GEF
EditPart
's “model” element. Typically, code such as
((View) editPart.
getModel()).getElement()
is used to access the underlying domain model
from an
EditPart
.
View
is the central class in the notation model, as you can tell from Figure
10-21. It contains the reference to the domain model element being represented
and also does the following:
Acts as the super type for
Diagram
,
Node
, and
Edge
❍
Maintains a containment reference to children
Node
s (transient and
persistent)
❍
Search WWH ::
Custom Search