public class Grid extends Component
GridLayoutData. May contain zero or more components as children. May not contain
Pane as children.
Child LayoutData: Children of this component may provide layout information using the
nextapp.echo.app.layout.GridLayoutData layout data object.
GridLayoutData,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_SIZE
Default grid column (or row) size (2).
|
static int |
ORIENTATION_HORIZONTAL
Constant value for
orientation property indicating cells
should be laid out horizontally and then vertically. |
static int |
ORIENTATION_VERTICAL
Constant value for
orientation property indicating cells
should be laid out vertically and then horizontally. |
static java.lang.String |
PROPERTY_BORDER |
static java.lang.String |
PROPERTY_COLUMN_WIDTH |
static java.lang.String |
PROPERTY_HEIGHT |
static java.lang.String |
PROPERTY_INSETS |
static java.lang.String |
PROPERTY_ORIENTATION |
static java.lang.String |
PROPERTY_ROW_HEIGHT |
static java.lang.String |
PROPERTY_SIZE |
static java.lang.String |
PROPERTY_WIDTH |
CHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_NEXT_ID_CHANGED_PROPERTY, FOCUS_PREVIOUS_ID_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY| Constructor and Description |
|---|
Grid()
Creates a new horizontally-oriented
Grid with the
default size (2). |
Grid(int size)
Creates a new horizontally-oriented
Grid with the
specified size. |
| Modifier and Type | Method and Description |
|---|---|
Border |
getBorder()
Returns the
Border. |
Extent |
getColumnWidth(int columnIndex)
Returns the width of the specified column.
|
Extent |
getHeight()
Returns the overall height.
|
Insets |
getInsets()
Returns the default cell insets.
|
int |
getOrientation()
Returns the orientation of the grid (either horizontal or vertical).
|
Extent |
getRowHeight(int rowIndex)
Returns the height of the specified row.
|
int |
getSize()
Returns the number of columns or rows in the
Grid. |
Extent |
getWidth()
Returns the overall width of the grid.
|
void |
setBorder(Border newValue)
Sets the
Border. |
void |
setColumnWidth(int columnIndex,
Extent newValue)
Sets the width of the specified column.
|
void |
setHeight(Extent newValue)
Sets the overall height of the grid.
|
void |
setInsets(Insets newValue)
Sets the default cell insets.
|
void |
setOrientation(int newValue)
Sets the orientation of the grid (either horizontal or vertical).
|
void |
setRowHeight(int rowIndex,
Extent newValue)
Sets the height of the specified row.
|
void |
setSize(int newValue)
Sets the number of columns or rows in the grid.
|
void |
setWidth(Extent newValue)
Sets the overall width of the grid.
|
add, add, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusNextId, getFocusPreviousId, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, processInput, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusNextId, setFocusPreviousId, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOfpublic static final int DEFAULT_SIZE
public static final int ORIENTATION_HORIZONTAL
orientation property indicating cells
should be laid out horizontally and then vertically.
ORIENTATION_HORIZONTAL is the default orientation setting.public static final int ORIENTATION_VERTICAL
orientation property indicating cells
should be laid out vertically and then horizontally.public static final java.lang.String PROPERTY_BORDER
public static final java.lang.String PROPERTY_COLUMN_WIDTH
public static final java.lang.String PROPERTY_HEIGHT
public static final java.lang.String PROPERTY_INSETS
public static final java.lang.String PROPERTY_ORIENTATION
public static final java.lang.String PROPERTY_ROW_HEIGHT
public static final java.lang.String PROPERTY_SIZE
public static final java.lang.String PROPERTY_WIDTH
public Grid()
Grid with the
default size (2).public Grid(int size)
Grid with the
specified size.size - the number of columnsgetSize()public Border getBorder()
Border.public Extent getColumnWidth(int columnIndex)
Extents with
fixed or percentile units.columnIndex - the column indexpublic Extent getHeight()
Extents with
fixed (i.e., not percent) units.public Insets getInsets()
Insets value
in their GridLayoutData.public int getOrientation()
ORIENTATION_HORIZONTAL (the default)
specifies that cells should be laid out in horizontal rows
with the size property specifying the number of columns
per row.
An orientation of ORIENTATION_VERTICAL
specifies that cells should be laid out in vertical columns
with the size property specifying the number of rows
per column.ORIENTATION_HORIZONTAL (the default)ORIENTATION_VERTICALsetOrientation(int)public Extent getRowHeight(int rowIndex)
Extents with
fixed (i.e., not percent) units.rowIndex - the row indexpublic int getSize()
Grid.
If the orientation property is set to
ORIENTATION_HORIZONTAL, this property represents the
number of columns in the Grid.
If the orientation property is set to
ORIENTATION_VERTICAL, this property represents the
number of rows in the Grid.public Extent getWidth()
Extents with
fixed or percentile units.public void setBorder(Border newValue)
Border.newValue - the new borderpublic void setColumnWidth(int columnIndex,
Extent newValue)
Extents with
fixed or percentile units.columnIndex - the column indexnewValue - the new widthpublic void setHeight(Extent newValue)
Extents with
fixed (i.e., not percent) units.newValue - the new heightpublic void setInsets(Insets newValue)
Insets value
in their GridLayoutData.newValue - the new default cell insetspublic void setOrientation(int newValue)
ORIENTATION_HORIZONTAL (the default)
specifies that cells should be laid out in horizontal rows
with the size property specifying the number of columns
per row.
An orientation of ORIENTATION_VERTICAL
specifies that cells should be laid out in vertical columns
with the size property specifying the number of rows
per column.newValue - the new orientation, one of the following values:
ORIENTATION_HORIZONTAL (the default)ORIENTATION_VERTICALpublic void setRowHeight(int rowIndex,
Extent newValue)
Extents with
fixed (i.e., not percent) units.rowIndex - the row indexnewValue - the new heightpublic void setSize(int newValue)
orientation property is set to
ORIENTATION_HORIZONTAL, this property represents the
number of columns in the Grid.
If the orientation property is set to
ORIENTATION_VERTICAL, this property represents the
number of rows in the Grid.newValue - the number of columns or rowsgetSize()public void setWidth(Extent newValue)
Extents with
fixed or percentile units.newValue - the new width