org.workjournal
Class JournalTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--org.workjournal.JournalTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class JournalTableModel
extends javax.swing.table.AbstractTableModel

JournalTableModel is a table model that is used by JournalTable to access a Journal, which is a collection of JournalEntry objects.

Author:
Thornton Rose
See Also:
JournalTable, JournalEntry, Serialized Form

Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
JournalTableModel(Journal journal)
          Construct a new journal table model.
 
Method Summary
 java.lang.Class getColumnClass(int col)
          Get the class of the given column.
 int getColumnCount()
          Get the number of columns to display.
 int getRowCount()
          Get the number of rows in the journal.
 java.lang.Object getValueAt(int row, int col)
          Get the value at the given row and column.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnName, getListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JournalTableModel

public JournalTableModel(Journal journal)
                  throws java.beans.IntrospectionException
Construct a new journal table model.
Method Detail

getRowCount

public int getRowCount()
Get the number of rows in the journal.
Overrides:
getRowCount in class javax.swing.table.AbstractTableModel

getColumnCount

public int getColumnCount()
Get the number of columns to display.
Overrides:
getColumnCount in class javax.swing.table.AbstractTableModel

getColumnClass

public java.lang.Class getColumnClass(int col)
Get the class of the given column.
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Get the value at the given row and column. The JournalEntry property for the given column is retrieved from the column-property map, and the entry bean proxy is used to fetch the property value for the entry bean at the given row.
Overrides:
getValueAt in class javax.swing.table.AbstractTableModel