org.jbudget.gui.month
Class DatesTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.jbudget.gui.month.DatesTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class DatesTableModel
extends javax.swing.table.AbstractTableModel

Implements a table model for a single row of the days of the month.

Author:
petrov
See Also:
Serialized Form

Field Summary
private  java.util.Calendar calendar
          A calendar instance.
private  java.util.List<java.lang.Integer> days
          The list of days of the month which will be displayed
private  org.jbudget.Core.Month month
          The month which is represented by this table
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
DatesTableModel(org.jbudget.Core.Month month)
          Creates a new instance of DatesTableModel
 
Method Summary
 int findRow(java.util.Date date)
           
 java.lang.Class getColumnClass(int index)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int index)
           
 int getDayAt(int rowIndex)
           
 int getRowCount()
           
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
           
protected  void initialize()
          Creates a list of days that are displayed.
 
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
 

Field Detail

month

private final org.jbudget.Core.Month month
The month which is represented by this table


days

private final java.util.List<java.lang.Integer> days
The list of days of the month which will be displayed


calendar

private final java.util.Calendar calendar
A calendar instance.

Constructor Detail

DatesTableModel

public DatesTableModel(org.jbudget.Core.Month month)
Creates a new instance of DatesTableModel

Method Detail

initialize

protected void initialize()
Creates a list of days that are displayed. This can be either all days of the month or just the days that have some activity


getColumnClass

public java.lang.Class getColumnClass(int index)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel

getColumnName

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

getColumnCount

public int getColumnCount()

getRowCount

public int getRowCount()

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)

getDayAt

public int getDayAt(int rowIndex)

findRow

public int findRow(java.util.Date date)