|
NextApp Echo 1.0.5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.Component
nextapp.echo.Grid
A component used to lay out child components in a grid.
Nested Class Summary | |
static class |
Grid.Cell
A container component representing a single cell of a grid. |
class |
Grid.GridCellOverlapException
An exception that is thrown when grid cells overlap (due to their column/row spans). |
Field Summary | |
static java.lang.String |
BORDER_COLOR_CHANGED_PROPERTY
|
static java.lang.String |
BORDER_SIZE_CHANGED_PROPERTY
|
static java.lang.String |
CELL_MARGIN_CHANGED_PROPERTY
|
static java.lang.String |
COLUMN_DELETED_PROPERTY
|
static java.lang.String |
COLUMN_INSERTED_PROPERTY
|
static java.lang.String |
COLUMN_WIDTH_CHANGED_PROPERTY
|
static java.lang.String |
HEIGHT_CHANGED_PROPERTY
|
static java.lang.String |
HEIGHT_UNITS_CHANGED_PROPERTY
|
static int |
PERCENT_INDIVIDUAL_PIXEL_TOTAL_UNITS
A constant used in the setWidthUnits() and
setHeightUnits() methods. |
static int |
PERCENT_UNITS
A constant used in the setWidthUnits() and
setHeightUnits() methods. |
static int |
PIXEL_UNITS
A constant used in the setWidthUnits() and
setHeightUnits() methods. |
static java.lang.String |
ROW_DELETED_PROPERTY
|
static java.lang.String |
ROW_HEIGHT_CHANGED_PROPERTY
|
static java.lang.String |
ROW_INSERTED_PROPERTY
|
static java.lang.String |
STYLE_BORDER_COLOR
A style constant for the Border Color property. |
static java.lang.String |
STYLE_BORDER_SIZE
A style constant for the Border Size property. |
static java.lang.String |
STYLE_CELL_MARGIN
A style constant for the Cell Margin property. |
static java.lang.String |
STYLE_COLUMN_WIDTHS
A style constant for the setting column widths. |
static java.lang.String |
STYLE_HEIGHT
A style constant for the Height property. |
static java.lang.String |
STYLE_HEIGHT_UNITS
A style constant for the Height Units property. |
static java.lang.String |
STYLE_ROW_HEIGHTS
A style constant for the setting row heights. |
static java.lang.String |
STYLE_WIDTH
A style constant for the Width property. |
static java.lang.String |
STYLE_WIDTH_UNITS
A style constant for the Width Units property. |
static int |
UNKNOWN_SIZE
Deprecated. Use EchoConstants.UNDEFINED_SIZE. |
static java.lang.String |
WIDTH_CHANGED_PROPERTY
|
static java.lang.String |
WIDTH_UNITS_CHANGED_PROPERTY
|
Constructor Summary | |
Grid()
Creates a new Grid. |
Method Summary | |
void |
add(Component c,
int index)
Throws an UnsupportedOperationException . |
Grid.Cell |
add(int column,
int row,
Component component)
Creates a new Cell containing only the given component and adds it at the specified position. |
void |
add(int column,
int row,
Grid.Cell cell)
Adds a cell at a specified coordinate. |
void |
applyStyle(Style style)
Sets stylistic properties of this component based on a Style object. |
void |
deleteColumn(int column)
Remove a column from the grid. |
void |
deleteRow(int row)
Remove a row from the grid. |
Grid.Cell |
get(int column,
int row)
Returns the Cell at the specified position |
Color |
getBorderColor()
Returns the border color. |
int |
getBorderSize()
Returns the border size. |
int |
getCellMargin()
Returns the cell margin. |
int |
getColumnWidth(int column)
Returns the width of a grid column. |
int |
getHeight()
Returns the overall height of the grid. |
int |
getHeightUnits()
Returns the units (pixel or percent) in which column heights and overall grid height are measured. |
int |
getRowHeight(int row)
Returns the height of a grid row. |
Dimension |
getSize()
Returns the size of the grid. |
int |
getWidth()
Returns the overall width of the grid. |
int |
getWidthUnits()
Returns the units (pixel or percent) in which column widths and overall grid width are measured. |
void |
insertColumn(int column)
Inserts a column into the grid. |
void |
insertRow(int row)
Inserts a row into the grid. |
java.util.Iterator |
iterator()
Returns a sequential (column then row) iterator over all cells in the grid. |
void |
remove(Component cell)
Removes the specified Cell. |
Grid.Cell |
remove(int column,
int row)
Removes and returns the cell at the specified position. |
void |
setBorderColor(Color newValue)
Sets the border color of the grid. |
void |
setBorderSize(int newValue)
Sets the size of the grid's border. |
void |
setCellMargin(int newValue)
Sets the cell interior margin. |
void |
setColumnWidth(int column,
int newValue)
Sets the width of a column of the grid. |
void |
setHeight(int newValue)
Sets the overall height of the grid. |
void |
setHeightUnits(int newValue)
Sets the units (pixel or percent) in which row heights and overall grid height are measured. |
void |
setRowHeight(int row,
int newValue)
Sets the height of a row of the grid. |
void |
setWidth(int newValue)
Sets the overall width of the grid. |
void |
setWidthUnits(int newValue)
Sets the units (pixel or percent) in which column widths and overall grid width are measured. |
void |
validate()
Overrides Component.validate(), to ensure that no cells of the grid overlap. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String STYLE_BORDER_COLOR
public static final java.lang.String STYLE_BORDER_SIZE
public static final java.lang.String STYLE_CELL_MARGIN
public static final java.lang.String STYLE_COLUMN_WIDTHS
public static final java.lang.String STYLE_HEIGHT
public static final java.lang.String STYLE_HEIGHT_UNITS
public static final java.lang.String STYLE_ROW_HEIGHTS
public static final java.lang.String STYLE_WIDTH
public static final java.lang.String STYLE_WIDTH_UNITS
public static final java.lang.String BORDER_COLOR_CHANGED_PROPERTY
public static final java.lang.String BORDER_SIZE_CHANGED_PROPERTY
public static final java.lang.String CELL_MARGIN_CHANGED_PROPERTY
public static final java.lang.String COLUMN_DELETED_PROPERTY
public static final java.lang.String COLUMN_INSERTED_PROPERTY
public static final java.lang.String COLUMN_WIDTH_CHANGED_PROPERTY
public static final java.lang.String HEIGHT_CHANGED_PROPERTY
public static final java.lang.String HEIGHT_UNITS_CHANGED_PROPERTY
public static final java.lang.String ROW_DELETED_PROPERTY
public static final java.lang.String ROW_HEIGHT_CHANGED_PROPERTY
public static final java.lang.String ROW_INSERTED_PROPERTY
public static final java.lang.String WIDTH_CHANGED_PROPERTY
public static final java.lang.String WIDTH_UNITS_CHANGED_PROPERTY
public static final int UNKNOWN_SIZE
public static final int PIXEL_UNITS
setWidthUnits()
and
setHeightUnits()
methods.
This value specifies that pixel-based units are used
in defining the individual column or row sizes and the
overall width and height of the grid.
public static final int PERCENT_INDIVIDUAL_PIXEL_TOTAL_UNITS
setWidthUnits()
and
setHeightUnits()
methods.
This value specifies that percent-based units are used
in defining the individual column or row sizes, but pixel based units
are used in defining the overall width or height of the grid.
public static final int PERCENT_UNITS
setWidthUnits()
and
setHeightUnits()
methods.
This value specifies that percent-based are used in defining both the
individual column or row sizes and the overall width or height of the
grid.
Constructor Detail |
public Grid()
Method Detail |
public void add(Component c, int index)
UnsupportedOperationException
.
add
in class Component
c
- The child component to add.index
- The index at which to add the child component, or -1 to add the
component at the end.Component.add(Component, int)
public void add(int column, int row, Grid.Cell cell)
column
- The column at which to add the component.row
- The row at which to add the component.cell
- The cell to be added.public Grid.Cell add(int column, int row, Component component)
column
- The column at which to add the component.row
- The row at which to add the component.component
- The component to be added.
Cell
object that was added to the grid at the
specified coordinate, containing the specified component.
This value is useful if the application needs to set additional
properties on the cell.public void applyStyle(Style style)
Component
Style
object. The version of this method in
Component
will set foreground and background colors
and the font from the style if they are present. Components
should override this method if they allow more properties to be
set from a style object, and should call super.applyStyle() if
necessary.
applyStyle
in class Component
style
- The style object from which to retrieve properties
for this Component
.Component.applyStyle(Style)
public void deleteColumn(int column)
column
- The column to remove from the grid.public void deleteRow(int row)
row
- The row to remove from the grid.public void insertColumn(int column)
column
- The index of the inserted column.public void insertRow(int row)
row
- The index of the inserted row.public java.util.Iterator iterator()
public Grid.Cell get(int column, int row)
column
- The column number of the cell to retrieve.row
- The row number of the cell to retrieve.
public Color getBorderColor()
public int getBorderSize()
public int getCellMargin()
public int getColumnWidth(int column)
EchoConstants.UNDEFINED_SIZE
is returned.
The units for this value may be pixels or percentiles, based on the
value of the "WidthUnits" property.
column
- The column index.
public int getHeight()
EchoConstants.UNDEFINED_SIZE
is returned.public int getHeightUnits()
PIXEL_UNITS
(the default)PERCENT_INDIVIDUAL_PIXEL_TOTAL_UNITS
PERCENT_UNITS
public int getRowHeight(int row)
EchoConstants.UNDEFINED_SIZE
is returned.
The units for this value may be pixels or percentiles, based on the
value of the "HeightUnits" property.
row
- The row index.
public Dimension getSize()
Dimension
.public int getWidth()
EchoConstants.UNDEFINED_SIZE
is returned.public int getWidthUnits()
PIXEL_UNITS
(the default)PERCENT_INDIVIDUAL_PIXEL_TOTAL_UNITS
PERCENT_UNITS
public Grid.Cell remove(int column, int row)
column
- The column number of the cell to remove.row
- The row number of the cell to remove.
public void remove(Component cell)
remove
in class Component
cell
- The cell to be removed.public void setBorderColor(Color newValue)
newValue
- The border color of the grid.public void setBorderSize(int newValue)
newValue
- The size of the grid's border, in pixels.public void setCellMargin(int newValue)
newValue
- The cell margin, in pixels.public void setColumnWidth(int column, int newValue)
column
- The column number.newValue
- The new width of the specified column.public void setHeight(int newValue)
newValue
- The new height of the grid. To set the height to be
undefined, use the EchoConstants.UNDEFINED_SIZE
constant.public void setHeightUnits(int newValue)
newValue
- The new unit measurement, one of the following values:
PIXEL_UNITS
(the default)PERCENT_INDIVIDUAL_PIXEL_TOTAL_UNITS
PERCENT_UNITS
public void setRowHeight(int row, int newValue)
row
- The row number.newValue
- The new height of the specified row.public void setWidth(int newValue)
newValue
- The new width of the grid. To set the width to be
undefined, use the EchoConstants.UNDEFINED_SIZE
constant.public void setWidthUnits(int newValue)
newValue
- The new unit measurement, one of the following values:
PIXEL_UNITS
(the default)PERCENT_INDIVIDUAL_PIXEL_TOTAL_UNITS
PERCENT_UNITS
public void validate()
GridCellOverlapException
is thrown.
validate
in class Component
|
NextApp Echo 1.0.5 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |