Class ColouredJTable

  extended by charva.awt.Component
      extended by charvax.swing.JComponent
          extended by charvax.swing.JTable
              extended by GUI.ColouredJTable
All Implemented Interfaces:
charva.awt.event.EventListener, charva.awt.Scrollable, charvax.swing.event.ListSelectionListener, charvax.swing.event.TableModelListener

public class ColouredJTable
extends charvax.swing.JTable
implements charvax.swing.event.TableModelListener, charva.awt.Scrollable, charvax.swing.event.ListSelectionListener

JTable is a user-interface component that displays data in a two- dimensional table format.

The user-interface works as follows:

The user can select a column by pressing the left or right arrow keys to move to the desired column, and then pressing ENTER.
He/she can select a row by pressing the up and down arrow keys to move to the desired row, then pressing ENTER.
Depending on the value of the selection mode, multiple rows and/or columns may be selected. By default the selection mode is set to SINGLE_SELECTION so that only a single row or column can be selected at a time. Selection of rows and/or columns can be enabled/disabled by means of the setRowSelectionAllowed() and setColumnSelectionAllowed() methods.

Field Summary
Fields inherited from class charvax.swing.JTable
_columnSelectionModel, _rowSelectionModel
Fields inherited from class charvax.swing.JComponent
Fields inherited from class charva.awt.Component
_alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor Summary
          Default constructor
ColouredJTable(charvax.swing.table.TableModel model_)
          Construct a JTable with the specified data model.
Method Summary
 void draw()
 boolean getColumnSelectionAllowed()
          Returns true if columns can be selected; otherwise false.
 boolean getRowSelectionAllowed()
          Returns true if rows can be selected; otherwise false.
 java.lang.Object getValueAt(int row_, int column_)
 void processKeyEvent(charva.awt.event.KeyEvent ke_)
 void setColumnSelectionAllowed(boolean allowed_)
          Set whether selection of columns is allowed.
 void setRowSelectionAllowed(boolean allowed_)
          Set whether selection of rows is allowed.
Methods inherited from class charvax.swing.JTable
addColumnSelectionInterval, addRowSelectionInterval, addScrollListener, debug, getHeight, getModel, getPreferredScrollableViewportSize, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionMode, getSelectionModel, getSize, getWidth, isColumnSelected, isRowSelected, minimumSize, processScrollEvent, removeScrollListener, requestFocus, setColumnSelectionInterval, setModel, setPreferredScrollableViewportSize, setRowSelectionInterval, setSelectionMode, setSelectionModel, setValueAt, tableChanged, valueChanged
Methods inherited from class charvax.swing.JComponent
getBorder, getInsets, setBorder
Methods inherited from class charva.awt.Component
addFocusListener, addKeyListener, contains, contains, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getLocation, getLocationOnScreen, getName, getParent, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isTotallyObscured, isValid, isVisible, processEvent, processFocusEvent, processMouseEvent, repaint, requestSync, setBackground, setBounds, setBounds, setBounds, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface charvax.swing.event.TableModelListener
Methods inherited from interface charva.awt.Scrollable
addScrollListener, getLocation, getPreferredScrollableViewportSize, processScrollEvent, removeScrollListener
Methods inherited from interface charvax.swing.event.ListSelectionListener

Constructor Detail


public ColouredJTable()
Default constructor


public ColouredJTable(charvax.swing.table.TableModel model_)
Construct a JTable with the specified data model.

Method Detail


public java.lang.Object getValueAt(int row_,
                                   int column_)
getValueAt in class charvax.swing.JTable


public void draw()
draw in class charvax.swing.JTable


public void processKeyEvent(charva.awt.event.KeyEvent ke_)
processKeyEvent in class charvax.swing.JTable


public void setColumnSelectionAllowed(boolean allowed_)
Set whether selection of columns is allowed.

setColumnSelectionAllowed in class charvax.swing.JTable


public boolean getColumnSelectionAllowed()
Returns true if columns can be selected; otherwise false.

getColumnSelectionAllowed in class charvax.swing.JTable


public void setRowSelectionAllowed(boolean allowed_)
Set whether selection of rows is allowed.

setRowSelectionAllowed in class charvax.swing.JTable


public boolean getRowSelectionAllowed()
Returns true if rows can be selected; otherwise false.

getRowSelectionAllowed in class charvax.swing.JTable