edu.northwestern.at.utils.swing
Class TableModelMapper

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by edu.northwestern.at.utils.swing.TableModelMapper
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class TableModelMapper
extends javax.swing.table.AbstractTableModel

Table model that eliminates hidden (zero width) columns.

See Also:
Serialized Form

Field Summary
protected  javax.swing.JTable table
          Table being mapped.
protected  int[] visibleToAll
          Map from visible column index to all columns index.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
TableModelMapper(javax.swing.JTable table)
          Create a table model that eliminates hidden columns.
 
Method Summary
 int getColumnCount()
          Get number of columns in table.
 int getRowCount()
          Get number of rows in table.
 java.lang.Object getValueAt(int row, int column)
          Get table value at a specified row and column.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected javax.swing.JTable table
Table being mapped.


visibleToAll

protected int[] visibleToAll
Map from visible column index to all columns index.

Constructor Detail

TableModelMapper

public TableModelMapper(javax.swing.JTable table)
Create a table model that eliminates hidden columns.

Parameters:
table - The table with possibly empty columns.
Method Detail

getRowCount

public int getRowCount()
Get number of rows in table.

Returns:
The number of rows in the table.

getColumnCount

public int getColumnCount()
Get number of columns in table.

Returns:
The number of columns in the table.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Get table value at a specified row and column.

Parameters:
row - The table row.
column - The table column.
Returns:
The table at the specified row and column in then table, or null if none.