Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nextapp.echo2.app
Class Grid

    java.lang.Object
      nextapp.echo2.app.Component
          nextapp.echo2.app.Grid

All Implemented Interfaces:
  java.io.Serializable, RenderIdSupport

    public class Grid

extends Component

A layout `Component` which renders its contents in a grid. Each component is contained within a "cell" of the grid. `GridLayoutData` layout data objects may used to cause cells to expand to fill multiple columns or rows.

Child LayoutData: Children of this component may provide layout information using the `nextapp.echo2.app.layout.GridLayoutData` layout data object.

See Also:
  `GridLayoutData`, Serialized Form

Field Summary
`static int` | `DEFAULT_SIZE`
`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`

Fields inherited from class nextapp.echo2.app.Component
`CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_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 Summary
`Grid()` Creates a new horizontally-oriented `Grid` with the default size (2).
`Grid(int size)` Creates a new hoirzontally-oriented `Grid` with the specified size.

Method Summary
`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.

Methods inherited from class nextapp.echo2.app.Component
`add, add, addPropertyChangeListener, dispose, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, 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, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_SIZE

    public static final int DEFAULT_SIZE

See Also:
  Constant Field Values

### ORIENTATION_HORIZONTAL

    public static final int ORIENTATION_HORIZONTAL

  Constant value for `orientation` property indicating cells should be laid out horizontally and then vertically. `ORIENTATION_HORIZONTAL` is the default orientation setting.

  See Also:
    Constant Field Values

### ORIENTATION_VERTICAL

    public static final int ORIENTATION_VERTICAL

  Constant value for `orientation` property indicating cells should be laid out vertically and then horizontally.

  See Also:
    Constant Field Values

### PROPERTY_BORDER

    public static final java.lang.String PROPERTY_BORDER

See Also:
  Constant Field Values

### PROPERTY_COLUMN_WIDTH

    public static final java.lang.String PROPERTY_COLUMN_WIDTH

See Also:
  Constant Field Values

### PROPERTY_HEIGHT

    public static final java.lang.String PROPERTY_HEIGHT

See Also:
  Constant Field Values

### PROPERTY_INSETS

    public static final java.lang.String PROPERTY_INSETS

See Also:
  Constant Field Values

### PROPERTY_ORIENTATION

    public static final java.lang.String PROPERTY_ORIENTATION

See Also:
  Constant Field Values

### PROPERTY_ROW_HEIGHT

    public static final java.lang.String PROPERTY_ROW_HEIGHT

See Also:
  Constant Field Values

### PROPERTY_SIZE

    public static final java.lang.String PROPERTY_SIZE

See Also:
  Constant Field Values

### PROPERTY_WIDTH

    public static final java.lang.String PROPERTY_WIDTH

See Also:
  Constant Field Values

Constructor Detail

### Grid

    public Grid()

  Creates a new horizontally-oriented `Grid` with the default size (2).

### Grid

    public Grid(int size)

  Creates a new hoirzontally-oriented `Grid` with the specified size.

  Parameters:
    `size` - the number of columns
  See Also:
    `getSize()`

Method Detail

### getBorder

    public Border getBorder()

  Returns the `Border`.

  Returns:
    the border

### getColumnWidth

    public Extent getColumnWidth(int columnIndex)

  Returns the width of the specified column. This property supports `Extent`s with fixed or percentile units.

  Parameters:
    `columnIndex` - the column index
  Returns:
    the width

### getHeight

    public Extent getHeight()

  Returns the overall height. This property only supports `Extent`s with fixed (i.e., not percent) units.

  Returns:
    the height

### getInsets

    public Insets getInsets()

  Returns the default cell insets. The default cell insets will be used for individual child cells that do not provide an `Insets` value in their `GridLayoutData`.

  Returns:
    the default cell insets

### getOrientation

    public int getOrientation()

  Returns the orientation of the grid (either horizontal or vertical). The orientation describes the direction in which cells are laid out. An orientation of `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.

  Returns:
    the orientation, one of the following values:
    - `ORIENTATION_HORIZONTAL` (the default)
    - `ORIENTATION_VERTICAL`
  See Also:
    `setOrientation(int)`

### getRowHeight

    public Extent getRowHeight(int rowIndex)

  Returns the height of the specified row. This property only supports `Extent`s with fixed (i.e., not percent) units.

  Parameters:
    `rowIndex` - the row index
  Returns:
    the height

### getSize

    public int getSize()

  Returns the number of columns or rows in the `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`.

  Returns:
    the number of columns or rows

### getWidth

    public Extent getWidth()

  Returns the overall width of the grid. This property supports `Extent`s with fixed or percentile units.

  Returns:
    the width

### setBorder

    public void setBorder(Border newValue)

  Sets the `Border`.

  Parameters:
    `newValue` - the new border

### setColumnWidth

    public void setColumnWidth(int columnIndex,
                               Extent newValue)

  Sets the width of the specified column. This property supports `Extent`s with fixed or percentile units.

  Parameters:
    `columnIndex` - the column index
    `newValue` - the new width

### setHeight

    public void setHeight(Extent newValue)

  Sets the overall height of the grid. This property only supports `Extent`s with fixed (i.e., not percent) units.

  Parameters:
    `newValue` - the new height

### setInsets

    public void setInsets(Insets newValue)

  Sets the default cell insets. The default cell insets will be used for individual child cells that do not provide an `Insets` value in their `GridLayoutData`.

  Parameters:
    `newValue` - the new default cell insets

### setOrientation

    public void setOrientation(int newValue)

  Sets the orientation of the grid (either horizontal or vertical). The orientation describes the direction in which cells are laid out. An orientation of `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.

  Parameters:
    `newValue` - the new orientation, one of the following values:
    - `ORIENTATION_HORIZONTAL` (the default)
    - `ORIENTATION_VERTICAL`

### setRowHeight

    public void setRowHeight(int rowIndex,
                             Extent newValue)

  Sets the height of the specified row. This property only supports `Extent`s with fixed (i.e., not percent) units.

  Parameters:
    `rowIndex` - the row index
    `newValue` - the new height

### setSize

    public void setSize(int newValue)

  Sets the number of columns or rows in the 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`.

  Parameters:
    `newValue` - the number of columns or rows
  See Also:
    `getSize()`

### setWidth

    public void setWidth(Extent newValue)

  Sets the overall width of the grid. This property supports `Extent`s with fixed or percentile units.

  Parameters:
    `newValue` - the new width

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD