Venice 0.7beta

org.mov.ui
Class AbstractTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.mov.ui.AbstractTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel
Direct Known Subclasses:
AbstractQuoteModel, PortfolioModel

public abstract class AbstractTableModel
extends javax.swing.table.AbstractTableModel

Helper for constructing table models. This abstract table model allows you to pass a list of columns for describing a table. The model will then take care of returning information to the table about each column.

Author:
Andrew Leppard
See Also:
Column, Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
AbstractTableModel()
          Create a new table model with no columns.
AbstractTableModel(java.util.List columns)
          Create a new table model with the set of columns.
 
Method Summary
 Column getColumn(int columnNumber)
          Get a column.
 java.lang.Class getColumnClass(int columnNumber)
          Get data type of column data.
 int getColumnCount()
          Get number of columns in table.
 java.lang.String getColumnName(int columnNumber)
          Get short name of column.
 void setColumns(java.util.List columns)
          Sets the columns in the table model.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.table.TableModel
getRowCount, getValueAt
 

Constructor Detail

AbstractTableModel

public AbstractTableModel()
Create a new table model with no columns.


AbstractTableModel

public AbstractTableModel(java.util.List columns)
Create a new table model with the set of columns.

Parameters:
columns - Table's columns.
Method Detail

getColumnCount

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


getColumnName

public java.lang.String getColumnName(int columnNumber)
Get short name of column. This is the name that will be displayed in the table header.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
columnNumber - Column number.
Returns:
Column's short name.

getColumnClass

public java.lang.Class getColumnClass(int columnNumber)
Get data type of column data.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
columnNumber - Column number.
Returns:
Column data type

setColumns

public void setColumns(java.util.List columns)
Sets the columns in the table model.

Parameters:
columns - New columns.

getColumn

public Column getColumn(int columnNumber)
Get a column.

Parameters:
columnNumber - Column number.
Returns:
Column.

Venice 0.7beta