org.aitools.programd.interfaces.graphical
Class TableMap

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.aitools.programd.interfaces.graphical.TableMap
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.swing.event.TableModelListener, javax.swing.table.TableModel
Direct Known Subclasses:
TableSorter

public class TableMap
extends javax.swing.table.AbstractTableModel
implements javax.swing.event.TableModelListener

In a chain of data manipulators some behaviour is common. TableMap provides most of this behavour and can be subclassed by filters that only need to override a handful of specific methods. TableMap implements TableModel by routing all requests to its model, and TableModelListener by routing all events to its listeners. Inserting a TableMap which has not been subclassed into a chain of table filters should have no effect.

Author:
Philip Milne, Noel Bush
See Also:
Serialized Form

Field Summary
protected  javax.swing.table.TableModel model
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TableMap()
           
 
Method Summary
 java.lang.Class<?> getColumnClass(int aColumn)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int aColumn)
           
 javax.swing.table.TableModel getModel()
           
 int getRowCount()
           
 java.lang.Object getValueAt(int aRow, int aColumn)
           
 boolean isCellEditable(int row, int column)
           
 void setModel(javax.swing.table.TableModel modelToSet)
          Sets the TableMap's model to the given model.
 void setValueAt(java.lang.Object aValue, int aRow, int aColumn)
           
 void tableChanged(javax.swing.event.TableModelEvent e)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableDataChanged, fireTableChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected javax.swing.table.TableModel model
Constructor Detail

TableMap

public TableMap()
Method Detail

getModel

public javax.swing.table.TableModel getModel()
Returns:
the table model

setModel

public void setModel(javax.swing.table.TableModel modelToSet)
Sets the TableMap's model to the given model.

Parameters:
modelToSet - the model to set

getValueAt

public java.lang.Object getValueAt(int aRow,
                                   int aColumn)
Specified by:
getValueAt in interface javax.swing.table.TableModel
See Also:
TableModel.getValueAt(int, int)

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int aRow,
                       int aColumn)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel
See Also:
AbstractTableModel.setValueAt(java.lang.Object, int, int)

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel
See Also:
TableModel.getRowCount()

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel
See Also:
TableModel.getColumnCount()

getColumnName

public java.lang.String getColumnName(int aColumn)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
See Also:
AbstractTableModel.getColumnName(int)

getColumnClass

public java.lang.Class<?> getColumnClass(int aColumn)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
See Also:
AbstractTableModel.getColumnClass(int)

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
See Also:
AbstractTableModel.isCellEditable(int, int)

tableChanged

public void tableChanged(javax.swing.event.TableModelEvent e)
Specified by:
tableChanged in interface javax.swing.event.TableModelListener
See Also:
TableModelListener.tableChanged(javax.swing.event.TableModelEvent)