A GridFieldManager is created with a fixed number of rows and columns. Fields may be
added to the grid either in the next empty cell with the add() method or inserted
at a specific row and column location using the insert() method.

Row and column heights and widths may be specified as fixed sizes or may be automatically
sized with the available space divided evenly among the rows and columns.

The grid will scroll vertically if the heights of the rows exceeds the visible height of the grid,
and will scroll horizontally if the widths of the columns exceedst he visible width of the grid.

The cells in the grid are indexed from zero to (number of cells - 1).

Since:

BlackBerry API 5.0.0

Field Summary

static int

AUTO_SIZE
Indicates that rows or columns should be automatically sized, with the available space divided evently among the rows or columns.

static int

FIXED_SIZE
Indicates that rows and columns should have fixed sizes which can be specified with either
setColumnProperty or setRowProperty.

static int

PREFERRED_SIZE
Indicates that rows and columns should be sized according to the preferred size of the contained fields.

static int

PREFERRED_SIZE_WITH_MAXIMUM
Indicates that rows and columns should be sized according to the preferred size of the contained fields, with a specified maximum.

IllegalStateException - if the grid is already full. Empty cells at an equal or greater than the index
indicated by the row and column will be filled first.

Since:

BlackBerry API 5.0.0

getColumnWidth

public int getColumnWidth(int column)

Returns the width of the specified column.

Parameters:

column - the column for which to return the width

Returns:

the width of the given column

Since:

BlackBerry API 5.0.0

getRowHeight

public int getRowHeight(int row)

Returns the height of the specified row.

Parameters:

row - the row for which to return the height

Returns:

the height of the specified row

Since:

BlackBerry API 5.0.0

nextFocus

public int nextFocus(int direction,
int axis)

Retrieves the index of the next field that should be given focus.

This method is called by the framework during a trackball focus move
operation.

The direction parameter indicates the direction in which the focus
is moving: a value of 1 indicates that the focus is moving forward
(generally down and to the right), while a value of -1 indicates that
the focus is moving backwards (generally up and to the left).

value - the maximum value for PREFERRED_SIZE_WITH_MAXIMUM or the number of pixels for GridFieldManager.FIXED_SIZE. This parameter
is ignored for other properties

Since:

BlackBerry API 5.0.0

setRowPadding

public void setRowPadding(int padding)

Sets the padding between rows, in pixels.

Parameters:

padding -

Since:

BlackBerry API 5.0.0

setCellPadding

public void setCellPadding(int padding)

Sets the inner cell padding.

Parameters:

padding - the padding, in pixels, surrounding the contained field

Since:

BlackBerry API 5.0.0

sublayout

protected void sublayout(int width,
int height)

Implements custom layout features for this manager.

If implementing a manager with custom layout features, extend the Manager class and implement this method.
Invoking the sublayout method prompts your manager subclass to lay out controlled fields appropriately.
Manager.layout(int, int) invokes this method to perform custom layout handling.
A manager MUST call setPositionChild for each child during sublayout. Note that setExtent must also be called,
but it is the field's responsibility to do this in layout.

By default, this method paints all child fields,
without regard to the clipping region.

If implementing a custom manager that has requirements for special
paint handling, you can override this method for optimization:
Manager.paint(net.rim.device.api.ui.Graphics) invokes this method to perform custom paint functions.