Class evGridX
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----evGridX
- public class evGridX
- extends Panel
-
evGridX(int)
- Create a new grid
-
addHiddenData(int, String)
- add undisplayed data to a row.
-
addHiddenDataInt(int, int)
- add undisplayed integer data to a row.
-
addIcon(int, int, Image)
- Add a new icon to the grid.
-
addItem(int, int, String)
- Add a new item to the grid.
-
deleteRow(int)
- delete the specified row
-
disp()
- Force a repaint of the grid.
-
getGrid()
-
Return the actual grid object.
-
getHiddenData(int)
- Retrieve String data associated with a given row
-
getHiddenDataInt(int)
- Retrieve Integer data associated with a given row
-
getSelected()
- Get the current selected row
-
getSelectedCell(int)
- Gets the String contents of the a cell in the currently selected row
-
handleEvent(Event)
-
-
setColTitle(int, String)
- Set the title for a column.
-
setColWidth(int, int)
- Set the width of a given column
evGridX
public evGridX(int cols)
- Create a new grid
- Parameters:
- cols - Number of columns for this grid. Cannot be changed after construction.
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
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
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
handleEvent
public boolean handleEvent(Event evt)
- Overrides:
- handleEvent in class Component
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
getSelected
public int getSelected()
- Get the current selected row
- Returns:
- the selected row number, or -1 for no row selected
deleteRow
public void deleteRow(int row)
- delete the specified row
- Parameters:
- row - the row number to delete
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
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
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
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
disp
public void disp()
- Force a repaint of the grid. Valuable for non-multithreaded applications
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...
}
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