Java Reference
In-Depth Information
Layout
Each figure also has layout properties for its Layout and Layout Data . A num-
ber of Layout classes are available, with corresponding Layout Data where
appropriate. As usual, a Custom Layout element is available for those who
want to specify a custom class name.
Flow Layout
Flow Layout corresponds to GEF's org.eclipse.draw2d.FlowLayout class
and is used to arrange children of a figure in rows or columns. A number of
options are available for Flow Layout, as presented in Table 11-3.
Table 11-3
Flow Layout Properties
Property
Description
Default
Vertical (Orientation)
A Boolean property that determines whether the
False
components should be laid out vertically
(true) or horizontally (false).
Force Single Line
Causes the generation of a ToolbarLayout,
False
which allows elements to be compressed
(resized) so that they fit into a single
row/column.
Match Minor Size
In a horizontal layout, figures will have
False
the same height. In a vertical layout,
figures will have the same width.
Major Alignment
The alignment used for a row/column.
BEGINNING
[BEGINNING | CENTER | END | FILL]
Major Spacing
The spacing in pixels between elements
5
running parallel to the layout orientation.
Minor Alignment
The alignment used for elements within
BEGINNING
a row/column. [BEGINNING | CENTER
| END | FILL]
Minor Spacing
The spacing in pixels between elements
5
within a row or column.
For example, Figure 11-3 shows what the default Flow Layout settings pro-
duce using a simple Rectangle that can accept children Rectangle s. When the
Vertical property is set to true , the children are added vertically, not hori-
zontally, as shown.
 
Search WWH ::




Custom Search