Class evGridX

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----evGridX

public class evGridX
extends Panel

Constructor Index

 o evGridX(int)
Create a new grid

Method Index

 o addHiddenData(int, String)
add undisplayed data to a row.
 o addHiddenDataInt(int, int)
add undisplayed integer data to a row.
 o addIcon(int, int, Image)
Add a new icon to the grid.
 o addItem(int, int, String)
Add a new item to the grid.
 o deleteRow(int)
delete the specified row
 o disp()
Force a repaint of the grid.
 o getGrid()
Return the actual grid object.
 o getHiddenData(int)
Retrieve String data associated with a given row
 o getHiddenDataInt(int)
Retrieve Integer data associated with a given row
 o getSelected()
Get the current selected row
 o getSelectedCell(int)
Gets the String contents of the a cell in the currently selected row
 o handleEvent(Event)
 o setColTitle(int, String)
Set the title for a column.
 o setColWidth(int, int)
Set the width of a given column

Constructors

 o evGridX
 public evGridX(int cols)
Create a new grid

Parameters:
cols - Number of columns for this grid. Cannot be changed after construction.

Methods

 o getHiddenData
 public String getHiddenData(int row)
Retrieve String data associated with a given row

Parameters:
row - the row you want the hidden data for
Returns:
value of the hidden data
 o getHiddenDataInt
 public int getHiddenDataInt(int row)
Retrieve Integer data associated with a given row

Parameters:
row - the row you want the hidden data for
Returns:
value of the hidden data
 o addItem
 public void addItem(int col,
                     int row,
                     String value)
Add a new item to the grid.

Parameters:
col - the column (zero-based) of the data item
row - the row (zero-based) of the data item
value - String value for the row contents
 o handleEvent
 public boolean handleEvent(Event evt)
Overrides:
handleEvent in class Component
 o setColWidth
 public void setColWidth(int col,
                         int width)
Set the width of a given column

Parameters:
col - the (zero-based) colunmn to set
width - the width in pixel to which to set the column
 o getSelected
 public int getSelected()
Get the current selected row

Returns:
the selected row number, or -1 for no row selected
 o deleteRow
 public void deleteRow(int row)
delete the specified row

Parameters:
row - the row number to delete
 o addHiddenData
 public void addHiddenData(int row,
                           String value)
add undisplayed data to a row. Can be retrieved with getHiddenData()

Parameters:
row - the row number to which to add the data
value - the String to associate with the row
 o addHiddenDataInt
 public void addHiddenDataInt(int row,
                              int value)
add undisplayed integer data to a row. Can be retrieved with getHiddenData()

Parameters:
row - the row number to which to add the data
value - the integer to associate with the row
 o addIcon
 public void addIcon(int col,
                     int row,
                     Image img)
Add a new icon to the grid. Grid will display any icon without clipping. Make sure the icon is appropriately sized and loaded

Parameters:
col - the column (zero-based) of the icon
row - the row (zero-based) of the icon
img - an already loaded Image object
 o getSelectedCell
 public String getSelectedCell(int cell)
Gets the String contents of the a cell in the currently selected row

Parameters:
cell - the column number of the cell you wish to read
Returns:
the string contents of the cell
 o disp
 public void disp()
Force a repaint of the grid. Valuable for non-multithreaded applications

 o getGrid
 public Object getGrid()
Return the actual grid object. Primarily for identifying the grid in a handleEvent method
if (evt.target == myGrid.getGrid()) {
    //do something...
 }

 o setColTitle
 public void setColTitle(int col,
                         String title)
Set the title for a column.

Parameters:
col - The column to set the title for
title - The title to set the column to