Package org.eclipse.draw2d
Class GridData
java.lang.Object
org.eclipse.draw2d.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.
 
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intValue for horizontalAlignment or verticalAlignment.static final intValue for horizontalAlignment or verticalAlignment.static final intValue for horizontalAlignment or verticalAlignment.static final intValue for horizontalAlignment or verticalAlignment.static final intStyle bit fornew GridData(int)to resize the figure to fill the cell horizontally and vertically and to fit the remaining horizontal and vertical space.static final intStyle bit fornew GridData(int)to resize the figure to fill the cell horizontally and to fit the remaining horizontal space.static final intStyle bit fornew GridData(int)to resize the figure to fill the cell vertically and to fit the remaining vertical space.static final intStyle bit fornew GridData(int)to resize the figure to fit the remaining horizontal space.static final intStyle bit fornew GridData(int)to resize the figure to fit the remaining vertical space.booleangrabExcessHorizontalSpace specifies whether the cell will be made wide enough to fit the remaining horizontal space.booleangrabExcessVerticalSpace specifies whether the cell will be made tall enough to fit the remaining vertical space.intheightHint specifies a minimum height for the row.static final intStyle bit fornew GridData(int)to position the figure at the left of the cell.static final intStyle bit fornew GridData(int)to position the figure in the horizontal center of the cell.static final intStyle bit fornew GridData(int)to position the figure at the right of the cell.static final intStyle bit fornew GridData(int)to resize the figure to fill the cell horizontally.inthorizontalAlignment specifies how figures will be positioned horizontally within a cell.inthorizontalIndent specifies the number of pixels of indentation that will be placed along the left side of the cell.inthorizontalSpan specifies the number of column cells that the figure will take up.static final intStyle bit fornew GridData(int).static final intStyle bit fornew GridData(int)to position the figure in the vertical center of the cell.static final intStyle bit fornew GridData(int)to position the figure at the bottom of the cell.static final intStyle bit fornew GridData(int)to resize the figure to fill the cell vertically.intverticalAlignment specifies how figures will be positioned vertically within a cell.intverticalSpan specifies the number of row cells that the figure will take up.intwidthHint specifies a minimum width for the column.
- 
Constructor SummaryConstructorsConstructorDescriptionGridData()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
- 
Field Details- 
verticalAlignmentpublic int verticalAlignmentverticalAlignment specifies how figures will be positioned vertically within a cell. The default value is CENTER. Possible values are: SWT.BEGINNING (or SWT.TOP): Position the figure at the top of the cell SWT.CENTER: Position the figure in the vertical center of the cell SWT.END (or SWT.BOTTOM): Position the figure at the bottom of the cell SWT.FILL: Resize the figure to fill the cell vertically
- 
horizontalAlignmentpublic int horizontalAlignmenthorizontalAlignment specifies how figures will be positioned horizontally within a cell. The default value is BEGINNING. Possible values are: SWT.BEGINNING (or SWT.LEFT): Position the figure at the left of the cell SWT.CENTER: Position the figure in the horizontal center of the cell SWT.END (or SWT.RIGHT): Position the figure at the right of the cell SWT.FILL: Resize the figure to fill the cell horizontally
- 
widthHintpublic int widthHintwidthHint specifies a minimum width for the column. A value of SWT.DEFAULT indicates that no minimum width is specified. The default value is SWT.DEFAULT.
- 
heightHintpublic int heightHintheightHint specifies a minimum height for the row. A value of SWT.DEFAULT indicates that no minimum height is specified. The default value is SWT.DEFAULT.
- 
horizontalIndentpublic int horizontalIndenthorizontalIndent specifies the number of pixels of indentation that will be placed along the left side of the cell. The default value is 0.
- 
horizontalSpanpublic int horizontalSpanhorizontalSpan specifies the number of column cells that the figure will take up. The default value is 1.
- 
verticalSpanpublic int verticalSpanverticalSpan specifies the number of row cells that the figure will take up. The default value is 1.
- 
grabExcessHorizontalSpacepublic boolean grabExcessHorizontalSpacegrabExcessHorizontalSpace specifies whether the cell will be made wide enough to fit the remaining horizontal space. The default value is false.
- 
grabExcessVerticalSpacepublic boolean grabExcessVerticalSpacegrabExcessVerticalSpace specifies whether the cell will be made tall enough to fit the remaining vertical space. The default value is false.
- 
BEGINNINGpublic static final int BEGINNINGValue for horizontalAlignment or verticalAlignment. Position the figure at the top or left of the cell. Not recommended. Use SWT.BEGINNING, SWT.TOP or SWT.LEFT instead.- See Also:
 
- 
CENTERpublic static final int CENTERValue for horizontalAlignment or verticalAlignment. Position the figure in the vertical or horizontal center of the cell Not recommended. Use SWT.CENTER instead.- See Also:
 
- 
ENDpublic static final int ENDValue for horizontalAlignment or verticalAlignment. Position the figure at the bottom or right of the cell Not recommended. Use SWT.END, SWT.BOTTOM or SWT.RIGHT instead.- See Also:
 
- 
FILLpublic static final int FILLValue for horizontalAlignment or verticalAlignment. Resize the figure to fill the cell horizontally or vertically. Not recommended. Use SWT.FILL instead.- See Also:
 
- 
VERTICAL_ALIGN_BEGINNINGpublic static final int VERTICAL_ALIGN_BEGINNINGStyle bit fornew GridData(int). Position the figure at the top of the cell. Not recommended. Usenew GridData(int, SWT.BEGINNING, boolean, boolean)instead.- See Also:
 
- 
VERTICAL_ALIGN_CENTERpublic static final int VERTICAL_ALIGN_CENTERStyle bit fornew GridData(int)to position the figure in the vertical center of the cell. Not recommended. Usenew GridData(int, SWT.CENTER, boolean, boolean)instead.- See Also:
 
- 
VERTICAL_ALIGN_ENDpublic static final int VERTICAL_ALIGN_ENDStyle bit fornew GridData(int)to position the figure at the bottom of the cell. Not recommended. Usenew GridData(int, SWT.END, boolean, boolean)instead.- See Also:
 
- 
VERTICAL_ALIGN_FILLpublic static final int VERTICAL_ALIGN_FILLStyle bit fornew GridData(int)to resize the figure to fill the cell vertically. Not recommended. Usenew GridData(int, SWT.FILL, boolean, boolean)instead- See Also:
 
- 
HORIZONTAL_ALIGN_BEGINNINGpublic static final int HORIZONTAL_ALIGN_BEGINNINGStyle bit fornew GridData(int)to position the figure at the left of the cell. Not recommended. Usenew GridData(SWT.BEGINNING, int, boolean, boolean)instead.- See Also:
 
- 
HORIZONTAL_ALIGN_CENTERpublic static final int HORIZONTAL_ALIGN_CENTERStyle bit fornew GridData(int)to position the figure in the horizontal center of the cell. Not recommended. Usenew GridData(SWT.CENTER, int, boolean, boolean)instead.- See Also:
 
- 
HORIZONTAL_ALIGN_ENDpublic static final int HORIZONTAL_ALIGN_ENDStyle bit fornew GridData(int)to position the figure at the right of the cell. Not recommended. Usenew GridData(SWT.END, int, boolean, boolean)instead.- See Also:
 
- 
HORIZONTAL_ALIGN_FILLpublic static final int HORIZONTAL_ALIGN_FILLStyle bit fornew GridData(int)to resize the figure to fill the cell horizontally. Not recommended. Usenew GridData(SWT.FILL, int, boolean, boolean)instead.- See Also:
 
- 
GRAB_HORIZONTALpublic static final int GRAB_HORIZONTALStyle bit fornew GridData(int)to resize the figure to fit the remaining horizontal space. Not recommended. Usenew GridData(int, int, true, boolean)instead.- See Also:
 
- 
GRAB_VERTICALpublic static final int GRAB_VERTICALStyle bit fornew GridData(int)to resize the figure to fit the remaining vertical space. Not recommended. Usenew GridData(int, int, boolean, true)instead.- See Also:
 
- 
FILL_VERTICALpublic static final int FILL_VERTICALStyle bit fornew 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. Usenew GridData(int, SWT.FILL, boolean, true)instead.- See Also:
 
- 
FILL_HORIZONTALpublic static final int FILL_HORIZONTALStyle bit fornew 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. Usenew GridData(SWT.FILL, int, true, boolean)instead.- See Also:
 
- 
FILL_BOTHpublic static final int FILL_BOTHStyle bit fornew 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. Usenew GridData(SWT.FILL, SWT.FILL, true, true)instead.- See Also:
 
 
- 
- 
Constructor Details- 
GridDatapublic GridData()Constructs a new instance of GridData using default values.
- 
GridDatapublic GridData(int style) Constructs a new instance based on the GridData style. This constructor is not recommended.- Parameters:
- style- the GridData style
 
- 
GridDatapublic GridData(int horizontalAlignment, int verticalAlignment, boolean grabExcessHorizontalSpace, boolean grabExcessVerticalSpace) Constructs a new instance of GridData according to the parameters.- Parameters:
- horizontalAlignment- how figure will be positioned horizontally within a cell
- verticalAlignment- how figure will be positioned vertically within a cell
- grabExcessHorizontalSpace- whether cell will be made wide enough to fit the remaining horizontal space
- grabExcessVerticalSpace- whether cell will be made high enough to fit the remaining vertical space
 
- 
GridDatapublic GridData(int horizontalAlignment, int verticalAlignment, boolean grabExcessHorizontalSpace, boolean grabExcessVerticalSpace, int horizontalSpan, int verticalSpan) Constructs a new instance of GridData according to the parameters.- Parameters:
- horizontalAlignment- how figure will be positioned horizontally within a cell
- verticalAlignment- how figure will be positioned vertically within a cell
- grabExcessHorizontalSpace- whether cell will be made wide enough to fit the remaining horizontal space
- grabExcessVerticalSpace- whether cell will be made high enough to fit the remaining vertical space
- horizontalSpan- the number of column cells that the figure will take up
- verticalSpan- the number of row cells that the figure will take up
 
- 
GridDatapublic GridData(int width, int height) Constructs a new instance of GridData according to the parameters. A value of SWT.DEFAULT indicates that no minimum width or no minumum height is specified.- Parameters:
- width- a minimum width for the column
- height- a minimum height for the row
 
 
- 
- 
Method Details