All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.bulletproof.gui.TextGrid

java.lang.Object
   |
   +----com.bulletproof.gui.Component
           |
           +----com.bulletproof.gui.TextGrid

public class TextGrid
extends Component
implements ItemSelectable, AdjustmentListener, FocusListener, KeyListener
Class TextGrid represents an grid class that allows for auto loading from a database and also tracks key values for displayed values.


Variable Index

 o COLUMN_MOVED
Column moved event.
 o COLUMN_RESIZED
Column resized event.
 o columnOrder
 o ROW_RESIZED
Row resized event.
 o totalDataRows

Constructor Index

 o TextGrid()
Creates a List component.

Method Index

 o addActionListener(ActionListener)
 o addColumn(String, int, int)
Add an column to the grid.
 o addColumn(TextGridColumn)
Add an column to the grid.
 o addItemListener(ItemListener)
 o addRow(int, String, String[])
Add an item to the tree.
 o addRow(String, int, String, String[], String)
Add an item to the tree.
 o addRow(String, String[], String[], String)
Add an item to the tree.
 o addRow(String[], String[])
Add an item to the tree.
 o addRow(String[], String[], String)
Add an item to the tree.
 o adjustmentValueChanged(AdjustmentEvent)
 o clear()
Remove all the entries from the List.
 o focusGained(FocusEvent)
 o focusLost(FocusEvent)
 o getColumn(int)
Get the handle to the column header object for the selected column.
 o getColumnHeaderHeight()
Get the height in pixels of the column header
 o getCurrentColumn()
Get the column number of the cell that has the cursor in it
 o getCurrentRow()
Get the row number of the cell that has the cursor in it
 o getGridColor()
Get the color of the grig divider lines
 o getItemKey(int)
Get the key value of the selected item.
 o getPreferredSize()
Gets the preferred size of this component.
 o getPulldownComponent(int)
Get the pulldown component for the selected column.
 o getRow(int)
Get the handle to the row object for the selected row.
 o getRowItem(int)
Get the TextGridRow value of a specific item.
 o getScrollEastVisible()
Get whether the east scrollbar is visible
 o getScrollSouthVisible()
Get whether the south scrollbar is visible
 o getSelectedIndex()
Get the selected indexes in the List.
 o getSelectedIndexes()
Get the selected indexes in the List.
 o getSelectedKey()
Get the currently selected key value.
 o getSelectedObjects()
Returns the selected TextGridRows or null if no items are selected.
 o getSelectionEnd()
For the currently selected cell get the ending position of the selected text or the cursor position.
 o getSelectionStart()
For the currently selected cell get the starting position of the selected text or the cursor position.
 o getText()
Returns the text value of the current Cell
 o getText(int, int)
Get the text value of the specified cell.
 o getTotalColumns()
Get the total number of columns
 o getTotalRows()
Get the total number of rows
 o keyPressed(KeyEvent)
 o keyReleased(KeyEvent)
 o keyTyped(KeyEvent)
 o paint(Graphics)
Paints the component.
 o processMouseEvent(MouseEvent)
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.
 o reDraw()
 o removeActionListener(ActionListener)
 o removeItemListener(ItemListener)
 o removeRow(int)
Remove the selected row from the grid.
 o select(int, int)
Sets the new selected text value this Cell
 o setColumnHeaderHeight(int)
Set the height in pixels of the column header
 o setFont(Font)
Set the font
 o setGridColor(Color)
Set the color of the grig divider lines
 o setMasterDrawRegion(Rectangle)
Set the master drawing region for this coomponent.
 o setPulldownComponent(int, Component)
Set the pulldown component for the selected column.
 o setRowChanged(int, boolean)
Set the changed flag for the requested row.
 o setRowSelected(int, boolean)
Select the requested row.
 o setScrollEastVisible(boolean)
Set whether the east scrollbar should be visible
 o setScrollSouthVisible(boolean)
Set whether the south scrollbar should be visible
 o setText(String)
Sets the text value of the current Cell
 o setText(String, int, int)
Set the text value of the specified cell.
 o update(Graphics)
Updates the component.
 o updateColumn(int, TextGridColumn)
Update the values for the selected column.
 o updateRow(int, TextGridRow)
Update the values for the selected row.

Variables

 o columnOrder
 public int columnOrder[]
 o totalDataRows
 public int totalDataRows
 o COLUMN_MOVED
 public static final int COLUMN_MOVED
Column moved event.

 o COLUMN_RESIZED
 public static final int COLUMN_RESIZED
Column resized event.

 o ROW_RESIZED
 public static final int ROW_RESIZED
Row resized event.

Constructors

 o TextGrid
 public TextGrid()
Creates a List component.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.

Methods

 o addActionListener
 public void addActionListener(ActionListener al)
 o removeActionListener
 public void removeActionListener(ActionListener al)
 o addItemListener
 public void addItemListener(ItemListener al)
 o removeItemListener
 public void removeItemListener(ItemListener al)
 o getSelectedObjects
 public Object[] getSelectedObjects()
Returns the selected TextGridRows or null if no items are selected.

 o setScrollEastVisible
 public void setScrollEastVisible(boolean visible)
Set whether the east scrollbar should be visible

Parameters:
visible - flag.
 o getScrollEastVisible
 public boolean getScrollEastVisible()
Get whether the east scrollbar is visible

Returns:
whether visible or not.
 o setScrollSouthVisible
 public void setScrollSouthVisible(boolean visible)
Set whether the south scrollbar should be visible

Parameters:
visible - flag.
 o getScrollSouthVisible
 public boolean getScrollSouthVisible()
Get whether the south scrollbar is visible

Returns:
whether visible or not.
 o getCurrentColumn
 public int getCurrentColumn()
Get the column number of the cell that has the cursor in it

Returns:
the column number
 o getCurrentRow
 public int getCurrentRow()
Get the row number of the cell that has the cursor in it

Returns:
the row number
 o getTotalRows
 public int getTotalRows()
Get the total number of rows

Returns:
the total number of rows
 o getTotalColumns
 public int getTotalColumns()
Get the total number of columns

Returns:
the total number of columns
 o getGridColor
 public Color getGridColor()
Get the color of the grig divider lines

Returns:
the color of the grig divider lines
 o setFont
 public void setFont(Font font)
Set the font

Parameters:
font - the font for the grid
Overrides:
setFont in class Component
 o setGridColor
 public void setGridColor(Color color)
Set the color of the grig divider lines

Parameters:
color - the color of the grig divider lines
 o addColumn
 public TextGridColumn addColumn(String columnText,
                                 int columnWidth,
                                 int columnType)
Add an column to the grid.

Parameters:
columnText - the text for the column header.
columnWidth - the width of the column.
columnType - the type of the column. See TextGridColumn for the available types
 o addColumn
 public void addColumn(TextGridColumn column)
Add an column to the grid.

Parameters:
column - the TextGridColumn object to add to the grid.
 o getColumn
 public TextGridColumn getColumn(int columnNumber)
Get the handle to the column header object for the selected column.

Parameters:
columnNumber - the number for the column header.
Returns:
the TextGridColumn object.
 o updateColumn
 public void updateColumn(int columnNumber,
                          TextGridColumn t)
Update the values for the selected column.

Parameters:
columnNumber - the number for the column header.
column - the TextGridColumn object to use to update the column.
 o addRow
 public void addRow(String cellText[],
                    String actualKey[])
Add an item to the tree.

Parameters:
rowHeader - the text header of the row.
cellText - the text for each of the cells.
actualKey - the key value for this row.
 o addRow
 public void addRow(String cellText[],
                    String actualKey[],
                    String recordLockValue)
Add an item to the tree.

Parameters:
rowHeader - the text header of the row.
cellText - the text for each of the cells.
actualKey - the key value for this row.
 o addRow
 public void addRow(int cells,
                    String cellText,
                    String actualKey[])
Add an item to the tree.

Parameters:
rowHeader - the text header of the row.
cellText - the text for each of the cells.
actualKey - the key value for this row.
 o addRow
 public void addRow(String rowHeader,
                    String cellText[],
                    String actualKey[],
                    String recordLockValue)
Add an item to the tree.

Parameters:
rowHeader - the text header of the row.
cells - the text for each of the cells separated by \3.
actualKey - the key value for this row.
 o addRow
 public void addRow(String rowHeader,
                    int clen,
                    String cells,
                    String actualKey[],
                    String recordLockValue)
Add an item to the tree.

Parameters:
rowHeader - the text header of the row.
clen - the number of cells.
cells - the text for each of the cells separated by \3.
actualKey - the key value for this row.
 o removeRow
 public boolean removeRow(int rowNumber)
Remove the selected row from the grid. ReDraw should be called after the required rows are removed.

Parameters:
rowNumber - the number for the row.
Returns:
whether the row was successfully removed.
 o getRow
 public TextGridRow getRow(int rowNumber)
Get the handle to the row object for the selected row.

Parameters:
rowNumber - the number for the row.
Returns:
the TextGridRow object.
 o updateRow
 public void updateRow(int rowNumber,
                       TextGridRow t)
Update the values for the selected row.

Parameters:
rowNumber - the number for the row.
row - the TextGridRow object to use to update the row.
 o setText
 public void setText(String text,
                     int column,
                     int row)
Set the text value of the specified cell.

Parameters:
text - the new text value.
column - the column number of the cell.
row - the row number of the cell.
 o getText
 public String getText(int column,
                       int row)
Get the text value of the specified cell.

Parameters:
column - the column number of the cell.
row - the row number of the cell.
Returns:
the text value.
 o setText
 public void setText(String text)
Sets the text value of the current Cell

Parameters:
text - the text value of the current Cell
 o getText
 public String getText()
Returns the text value of the current Cell

Returns:
the text value of the current Cell
 o getSelectionStart
 public int getSelectionStart()
For the currently selected cell get the starting position of the selected text or the cursor position.

Returns:
the starting position of the selected text.
 o getSelectionEnd
 public int getSelectionEnd()
For the currently selected cell get the ending position of the selected text or the cursor position.

Returns:
the ending position of the selected text.
 o select
 public void select(int s0,
                    int s1)
Sets the new selected text value this Cell

Parameters:
the - new selected text from value this Cell
the - new selected text to value this Cell
 o setPulldownComponent
 public void setPulldownComponent(int column,
                                  Component comp)
Set the pulldown component for the selected column.

Parameters:
column - the column number for the pulldown. All of the columns should be added before the pulldown components are set.
comp - the component for the pulldown. This will generally be either a Choice or a Combobox that has it's items preloaded.
 o getPulldownComponent
 public Component getPulldownComponent(int column)
Get the pulldown component for the selected column.

Parameters:
column - the column number for the pulldown.
Returns:
the component for the pulldown. This will generally be either a Choice or a Combobox that has it's items preloaded.
 o clear
 public void clear()
Remove all the entries from the List.

 o setColumnHeaderHeight
 public void setColumnHeaderHeight(int height)
Set the height in pixels of the column header

Parameters:
the - height in pixels.
 o getColumnHeaderHeight
 public int getColumnHeaderHeight()
Get the height in pixels of the column header

Returns:
the height in pixels.
 o setRowSelected
 public void setRowSelected(int item,
                            boolean selected)
Select the requested row.

Parameters:
item - the item to select.
selected - whether the row is to be selected or not.
 o setRowChanged
 public void setRowChanged(int item,
                           boolean changed)
Set the changed flag for the requested row.

Parameters:
item - the item to set.
selected - whether the row is to be flagged as changed or not.
 o getRowItem
 public TextGridRow getRowItem(int item)
Get the TextGridRow value of a specific item.

Parameters:
itemNumber - the item number.
Returns:
the item.
 o getItemKey
 public String[] getItemKey(int item)
Get the key value of the selected item.

Parameters:
the - item number.
Returns:
the item key value.
 o getSelectedIndex
 public int getSelectedIndex()
Get the selected indexes in the List. Presently multiple selections are not supported so this function only returns one item.

Returns:
the list indexes that are selected.
 o getSelectedIndexes
 public int[] getSelectedIndexes()
Get the selected indexes in the List. Presently multiple selections are not supported so this function only returns one item.

Returns:
the list indexes that are selected.
 o getSelectedKey
 public String[] getSelectedKey()
Get the currently selected key value.

Returns:
the item key value.
 o setMasterDrawRegion
 public void setMasterDrawRegion(Rectangle region)
Set the master drawing region for this coomponent.

Parameters:
region - the specified master drawing region
Overrides:
setMasterDrawRegion in class Component
 o update
 public void update(Graphics g)
Updates the component.

Overrides:
update in class Component
 o paint
 public synchronized void paint(Graphics g)
Paints the component.

Overrides:
paint in class Component
 o keyPressed
 public synchronized void keyPressed(KeyEvent ke)
 o keyReleased
 public synchronized void keyReleased(KeyEvent ke)
 o keyTyped
 public synchronized void keyTyped(KeyEvent ke)
 o focusLost
 public synchronized void focusLost(FocusEvent fe)
 o focusGained
 public synchronized void focusGained(FocusEvent fe)
 o processMouseEvent
 public synchronized void processMouseEvent(MouseEvent me)
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.

Overrides:
processMouseEvent in class Component
 o adjustmentValueChanged
 public void adjustmentValueChanged(AdjustmentEvent e)
 o getPreferredSize
 public Dimension getPreferredSize()
Gets the preferred size of this component.

Overrides:
getPreferredSize in class Component
 o reDraw
 public void reDraw()

All Packages  Class Hierarchy  This Package  Previous  Next  Index