|
Draw2d 3.9.0.201308190730 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.draw2d.GridData
public final class GridData
GridData
is the layout data object associated with
GridLayout
. To set a GridData
object into a
Figure
, you use the setConstraint()
method of
GridLayout
to map the Figure
to its layout
GridData
.
There are two ways to create a GridData
object with certain
fields set. The first is to set the fields directly, like this:
GridData gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; // associate the figure to the GridData object myGridlayout.setConstraint(myFigure, gridData);The second is to take advantage of convenience style bits defined by
GridData
:
GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
NOTE: Do not reuse GridData
objects. Every child in the parent
Figure
that is managed by the GridLayout
must have
a unique GridData
object. If the layout data for a Grid member
in a GridLayout
is null at layout time, a unique
GridData
object is created for it.
GridLayout
Field Summary | |
---|---|
static int |
BEGINNING
Value for horizontalAlignment or verticalAlignment. |
static int |
CENTER
Value for horizontalAlignment or verticalAlignment. |
static int |
END
Value for horizontalAlignment or verticalAlignment. |
static int |
FILL
Value for horizontalAlignment or verticalAlignment. |
static int |
FILL_BOTH
Style bit for new GridData(int) to resize the figure to fill
the cell horizontally and vertically and to fit the remaining horizontal
and vertical space. |
static int |
FILL_HORIZONTAL
Style bit for new GridData(int) to resize the figure to fill
the cell horizontally and to fit the remaining horizontal space. |
static int |
FILL_VERTICAL
Style bit for new GridData(int) to resize the figure to fill
the cell vertically and to fit the remaining vertical space. |
static int |
GRAB_HORIZONTAL
Style bit for new GridData(int) to resize the figure to fit
the remaining horizontal space. |
static int |
GRAB_VERTICAL
Style bit for new GridData(int) to resize the figure to fit
the remaining vertical space. |
boolean |
grabExcessHorizontalSpace
grabExcessHorizontalSpace specifies whether the cell will be made wide enough to fit the remaining horizontal space. |
boolean |
grabExcessVerticalSpace
grabExcessVerticalSpace specifies whether the cell will be made tall enough to fit the remaining vertical space. |
int |
heightHint
heightHint specifies a minimum height for the row. |
static int |
HORIZONTAL_ALIGN_BEGINNING
Style bit for new GridData(int) to position the figure at
the left of the cell. |
static int |
HORIZONTAL_ALIGN_CENTER
Style bit for new GridData(int) to position the figure in
the horizontal center of the cell. |
static int |
HORIZONTAL_ALIGN_END
Style bit for new GridData(int) to position the figure at
the right of the cell. |
static int |
HORIZONTAL_ALIGN_FILL
Style bit for new GridData(int) to resize the figure to fill
the cell horizontally. |
int |
horizontalAlignment
horizontalAlignment specifies how figures will be positioned horizontally within a cell. |
int |
horizontalIndent
horizontalIndent specifies the number of pixels of indentation that will be placed along the left side of the cell. |
int |
horizontalSpan
horizontalSpan specifies the number of column cells that the figure will take up. |
static int |
VERTICAL_ALIGN_BEGINNING
Style bit for new GridData(int) . |
static int |
VERTICAL_ALIGN_CENTER
Style bit for new GridData(int) to position the figure in
the vertical center of the cell. |
static int |
VERTICAL_ALIGN_END
Style bit for new GridData(int) to position the figure at
the bottom of the cell. |
static int |
VERTICAL_ALIGN_FILL
Style bit for new GridData(int) to resize the figure to fill
the cell vertically. |
int |
verticalAlignment
verticalAlignment specifies how figures will be positioned vertically within a cell. |
int |
verticalSpan
verticalSpan specifies the number of row cells that the figure will take up. |
int |
widthHint
widthHint specifies a minimum width for the column. |
Constructor Summary | |
---|---|
GridData()
Constructs a new instance of GridData using default values. |
|
GridData(int style)
Constructs a new instance based on the GridData style. |
|
GridData(int width,
int height)
Constructs a new instance of GridData according to the parameters. |
|
GridData(int horizontalAlignment,
int verticalAlignment,
boolean grabExcessHorizontalSpace,
boolean grabExcessVerticalSpace)
Constructs a new instance of GridData according to the parameters. |
|
GridData(int horizontalAlignment,
int verticalAlignment,
boolean grabExcessHorizontalSpace,
boolean grabExcessVerticalSpace,
int horizontalSpan,
int verticalSpan)
Constructs a new instance of GridData according to the parameters. |
Method Summary | |
---|---|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int verticalAlignment
public int horizontalAlignment
public int widthHint
public int heightHint
public int horizontalIndent
public int horizontalSpan
public int verticalSpan
public boolean grabExcessHorizontalSpace
public boolean grabExcessVerticalSpace
public static final int BEGINNING
public static final int CENTER
public static final int END
public static final int FILL
public static final int VERTICAL_ALIGN_BEGINNING
new GridData(int)
. Position the figure at the
top of the cell. Not recommended. Use
new GridData(int, SWT.BEGINNING, boolean, boolean)
instead.
public static final int VERTICAL_ALIGN_CENTER
new GridData(int)
to position the figure in
the vertical center of the cell. Not recommended. Use
new GridData(int, SWT.CENTER, boolean, boolean)
instead.
public static final int VERTICAL_ALIGN_END
new GridData(int)
to position the figure at
the bottom of the cell. Not recommended. Use
new GridData(int, SWT.END, boolean, boolean)
instead.
public static final int VERTICAL_ALIGN_FILL
new GridData(int)
to resize the figure to fill
the cell vertically. Not recommended. Use
new GridData(int, SWT.FILL, boolean, boolean)
instead
public static final int HORIZONTAL_ALIGN_BEGINNING
new GridData(int)
to position the figure at
the left of the cell. Not recommended. Use
new GridData(SWT.BEGINNING, int, boolean, boolean)
instead.
public static final int HORIZONTAL_ALIGN_CENTER
new GridData(int)
to position the figure in
the horizontal center of the cell. Not recommended. Use
new GridData(SWT.CENTER, int, boolean, boolean)
instead.
public static final int HORIZONTAL_ALIGN_END
new GridData(int)
to position the figure at
the right of the cell. Not recommended. Use
new GridData(SWT.END, int, boolean, boolean)
instead.
public static final int HORIZONTAL_ALIGN_FILL
new GridData(int)
to resize the figure to fill
the cell horizontally. Not recommended. Use
new GridData(SWT.FILL, int, boolean, boolean)
instead.
public static final int GRAB_HORIZONTAL
new GridData(int)
to resize the figure to fit
the remaining horizontal space. Not recommended. Use
new GridData(int, int, true, boolean)
instead.
public static final int GRAB_VERTICAL
new GridData(int)
to resize the figure to fit
the remaining vertical space. Not recommended. Use
new GridData(int, int, boolean, true)
instead.
public static final int FILL_VERTICAL
new GridData(int)
to resize the figure to fill
the cell vertically and to fit the remaining vertical space.
FILL_VERTICAL = VERTICAL_ALIGN_FILL | GRAB_VERTICAL Not recommended. Use
new GridData(int, SWT.FILL, boolean, true)
instead.
public static final int FILL_HORIZONTAL
new GridData(int)
to resize the figure to fill
the cell horizontally and to fit the remaining horizontal space.
FILL_HORIZONTAL = HORIZONTAL_ALIGN_FILL | GRAB_HORIZONTAL Not
recommended. Use new GridData(SWT.FILL, int, true, boolean)
instead.
public static final int FILL_BOTH
new GridData(int)
to resize the figure to fill
the cell horizontally and vertically and to fit the remaining horizontal
and vertical space. FILL_BOTH = FILL_VERTICAL | FILL_HORIZONTAL Not
recommended. Use
new GridData(SWT.FILL, SWT.FILL, true, true)
instead.
Constructor Detail |
---|
public GridData()
public GridData(int style)
style
- the GridData stylepublic GridData(int horizontalAlignment, int verticalAlignment, boolean grabExcessHorizontalSpace, boolean grabExcessVerticalSpace)
horizontalAlignment
- how figure will be positioned horizontally within a cellverticalAlignment
- how figure will be positioned vertically within a cellgrabExcessHorizontalSpace
- whether cell will be made wide enough to fit the remaining
horizontal spacegrabExcessVerticalSpace
- whether cell will be made high enough to fit the remaining
vertical spacepublic GridData(int horizontalAlignment, int verticalAlignment, boolean grabExcessHorizontalSpace, boolean grabExcessVerticalSpace, int horizontalSpan, int verticalSpan)
horizontalAlignment
- how figure will be positioned horizontally within a cellverticalAlignment
- how figure will be positioned vertically within a cellgrabExcessHorizontalSpace
- whether cell will be made wide enough to fit the remaining
horizontal spacegrabExcessVerticalSpace
- whether cell will be made high enough to fit the remaining
vertical spacehorizontalSpan
- the number of column cells that the figure will take upverticalSpan
- the number of row cells that the figure will take uppublic GridData(int width, int height)
width
- a minimum width for the columnheight
- a minimum height for the rowMethod Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
|
Draw2d 3.9.0.201308190730 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |