Java Reference
In-Depth Information
of how to use various layouts to achieve the desired arrangement of your figure
elements. Specifically, the color modeling diagram archetype figures defined in
Section 4.6.1, “Diagram Definition,” illustrate how to use labels, nested rectan-
gles, and compartments.
11.1.3 Diagram Elements
Before Figures can be used in a diagram, they must be referenced by a Diagram
Element . These are siblings of Figure Gallery elements in the graphical def-
inition model and, therefore, are children of the Canvas element. Note that dia-
gram elements can reference the same Figure —or, put another way, each node
on a diagram does not need to have distinct figures. Figures can be reused within
the same graphical definition or from another graphical definition model.
In addition to a figure reference, a diagram element can contain Visual
Facet s. A Visual Facet is a way to add information to a diagram element for
use in generation. Five types of visual facets exist: General , Alignment ,
Gradient , Label Offset , and Default Size . A General facet enables you to
add arbitrary information, leaving it up to the template author to make use of
the data.
Alignment facets are currently used only for diagram labels used with links,
where constants from org.eclipse.draw2d.ConnectionLocation can be
specified ( MIDDLE = Alignment.CENTER, TARGET = Alignment.END,
SOURCE = Alignment.BEGINNING ).
Gradient is an unused facet, but it has a direction property and can be used
in custom templates.
Label Offset specifies an initial offset that a label is created in relation to
its figure, when a label is external to the node.
Default Size is useful in initializing a new element on a diagram to a cer-
tain set of dimensions. The code generated for this facet is in the
createNodePlate() method of the node edit part, whereas the Preferred
Size property of a figure sets its dimension of the figure itself. In other words,
a figure can be nested within other figures, while a Node created as a diagram
element that references a figure represents what is created on the diagram.
Therefore, the default size facet on a node determines the initial size of a diagram
element. Of course, if this facet on the node and the top-level figure has a pre-
ferred dimension that is larger, it is created at that size.
Nodes
In addition to the name, figure, and facets properties that all diagram elements
share, nodes have the following properties: Resize Constraint , Affixed
Search WWH ::




Custom Search