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.
-
COLUMN_MOVED
- Column moved event.
-
COLUMN_RESIZED
- Column resized event.
-
columnOrder
-
-
ROW_RESIZED
- Row resized event.
-
totalDataRows
-
-
TextGrid()
- Creates a List component.
-
addActionListener(ActionListener)
-
-
addColumn(String, int, int)
- Add an column to the grid.
-
addColumn(TextGridColumn)
- Add an column to the grid.
-
addItemListener(ItemListener)
-
-
addRow(int, String, String[])
- Add an item to the tree.
-
addRow(String, int, String, String[], String)
- Add an item to the tree.
-
addRow(String, String[], String[], String)
- Add an item to the tree.
-
addRow(String[], String[])
- Add an item to the tree.
-
addRow(String[], String[], String)
- Add an item to the tree.
-
adjustmentValueChanged(AdjustmentEvent)
-
-
clear()
- Remove all the entries from the List.
-
focusGained(FocusEvent)
-
-
focusLost(FocusEvent)
-
-
getColumn(int)
- Get the handle to the column header object for the selected column.
-
getColumnHeaderHeight()
- Get the height in pixels of the column header
-
getCurrentColumn()
- Get the column number of the cell that has the cursor in it
-
getCurrentRow()
- Get the row number of the cell that has the cursor in it
-
getGridColor()
- Get the color of the grig divider lines
-
getItemKey(int)
- Get the key value of the selected item.
-
getPreferredSize()
- Gets the preferred size of this component.
-
getPulldownComponent(int)
- Get the pulldown component for the selected column.
-
getRow(int)
- Get the handle to the row object for the selected row.
-
getRowItem(int)
- Get the TextGridRow value of a specific item.
-
getScrollEastVisible()
- Get whether the east scrollbar is visible
-
getScrollSouthVisible()
- Get whether the south scrollbar is visible
-
getSelectedIndex()
- Get the selected indexes in the List.
-
getSelectedIndexes()
- Get the selected indexes in the List.
-
getSelectedKey()
- Get the currently selected key value.
-
getSelectedObjects()
- Returns the selected TextGridRows or null if no items are selected.
-
getSelectionEnd()
- For the currently selected cell get the ending position of the selected text
or the cursor position.
-
getSelectionStart()
- For the currently selected cell get the starting position of the selected text
or the cursor position.
-
getText()
- Returns the text value of the current Cell
-
getText(int, int)
- Get the text value of the specified cell.
-
getTotalColumns()
- Get the total number of columns
-
getTotalRows()
- Get the total number of rows
-
keyPressed(KeyEvent)
-
-
keyReleased(KeyEvent)
-
-
keyTyped(KeyEvent)
-
-
paint(Graphics)
-
Paints the component.
-
processMouseEvent(MouseEvent)
-
Processes mouse events occurring on this component by
dispatching them to any registered MouseListener objects.
-
reDraw()
-
-
removeActionListener(ActionListener)
-
-
removeItemListener(ItemListener)
-
-
removeRow(int)
- Remove the selected row from the grid.
-
select(int, int)
- Sets the new selected text value this Cell
-
setColumnHeaderHeight(int)
- Set the height in pixels of the column header
-
setFont(Font)
- Set the font
-
setGridColor(Color)
- Set the color of the grig divider lines
-
setMasterDrawRegion(Rectangle)
-
Set the master drawing region for this coomponent.
-
setPulldownComponent(int, Component)
- Set the pulldown component for the selected column.
-
setRowChanged(int, boolean)
- Set the changed flag for the requested row.
-
setRowSelected(int, boolean)
- Select the requested row.
-
setScrollEastVisible(boolean)
- Set whether the east scrollbar should be visible
-
setScrollSouthVisible(boolean)
- Set whether the south scrollbar should be visible
-
setText(String)
- Sets the text value of the current Cell
-
setText(String, int, int)
- Set the text value of the specified cell.
-
update(Graphics)
-
Updates the component.
-
updateColumn(int, TextGridColumn)
- Update the values for the selected column.
-
updateRow(int, TextGridRow)
- Update the values for the selected row.
columnOrder
public int columnOrder[]
totalDataRows
public int totalDataRows
COLUMN_MOVED
public static final int COLUMN_MOVED
- Column moved event.
COLUMN_RESIZED
public static final int COLUMN_RESIZED
- Column resized event.
ROW_RESIZED
public static final int ROW_RESIZED
- Row resized event.
TextGrid
public TextGrid()
- Creates a List component.
- Parameters:
- JDPUser - the global user parameter used to pass handles in JDP.
addActionListener
public void addActionListener(ActionListener al)
removeActionListener
public void removeActionListener(ActionListener al)
addItemListener
public void addItemListener(ItemListener al)
removeItemListener
public void removeItemListener(ItemListener al)
getSelectedObjects
public Object[] getSelectedObjects()
- Returns the selected TextGridRows or null if no items are selected.
setScrollEastVisible
public void setScrollEastVisible(boolean visible)
- Set whether the east scrollbar should be visible
- Parameters:
- visible - flag.
getScrollEastVisible
public boolean getScrollEastVisible()
- Get whether the east scrollbar is visible
- Returns:
- whether visible or not.
setScrollSouthVisible
public void setScrollSouthVisible(boolean visible)
- Set whether the south scrollbar should be visible
- Parameters:
- visible - flag.
getScrollSouthVisible
public boolean getScrollSouthVisible()
- Get whether the south scrollbar is visible
- Returns:
- whether visible or not.
getCurrentColumn
public int getCurrentColumn()
- Get the column number of the cell that has the cursor in it
- Returns:
- the column number
getCurrentRow
public int getCurrentRow()
- Get the row number of the cell that has the cursor in it
- Returns:
- the row number
getTotalRows
public int getTotalRows()
- Get the total number of rows
- Returns:
- the total number of rows
getTotalColumns
public int getTotalColumns()
- Get the total number of columns
- Returns:
- the total number of columns
getGridColor
public Color getGridColor()
- Get the color of the grig divider lines
- Returns:
- the color of the grig divider lines
setFont
public void setFont(Font font)
- Set the font
- Parameters:
- font - the font for the grid
- Overrides:
- setFont in class Component
setGridColor
public void setGridColor(Color color)
- Set the color of the grig divider lines
- Parameters:
- color - the color of the grig divider lines
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
addColumn
public void addColumn(TextGridColumn column)
- Add an column to the grid.
- Parameters:
- column - the TextGridColumn object to add to the grid.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
setText
public void setText(String text)
- Sets the text value of the current Cell
- Parameters:
- text - the text value of the current Cell
getText
public String getText()
- Returns the text value of the current Cell
- Returns:
- the text value of the current Cell
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.
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.
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
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.
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.
clear
public void clear()
- Remove all the entries from the List.
setColumnHeaderHeight
public void setColumnHeaderHeight(int height)
- Set the height in pixels of the column header
- Parameters:
- the - height in pixels.
getColumnHeaderHeight
public int getColumnHeaderHeight()
- Get the height in pixels of the column header
- Returns:
- the height in pixels.
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.
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.
getRowItem
public TextGridRow getRowItem(int item)
- Get the TextGridRow value of a specific item.
- Parameters:
- itemNumber - the item number.
- Returns:
- the item.
getItemKey
public String[] getItemKey(int item)
- Get the key value of the selected item.
- Parameters:
- the - item number.
- Returns:
- the item key value.
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.
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.
getSelectedKey
public String[] getSelectedKey()
- Get the currently selected key value.
- Returns:
- the item key value.
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
update
public void update(Graphics g)
- Updates the component.
- Overrides:
- update in class Component
paint
public synchronized void paint(Graphics g)
- Paints the component.
- Overrides:
- paint in class Component
keyPressed
public synchronized void keyPressed(KeyEvent ke)
keyReleased
public synchronized void keyReleased(KeyEvent ke)
keyTyped
public synchronized void keyTyped(KeyEvent ke)
focusLost
public synchronized void focusLost(FocusEvent fe)
focusGained
public synchronized void focusGained(FocusEvent fe)
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
adjustmentValueChanged
public void adjustmentValueChanged(AdjustmentEvent e)
getPreferredSize
public Dimension getPreferredSize()
- Gets the preferred size of this component.
- Overrides:
- getPreferredSize in class Component
reDraw
public void reDraw()
All Packages Class Hierarchy This Package Previous Next Index