com.isti.util.gui
Class IstiCalendarPanel.CalendarTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.isti.util.gui.IstiCalendarPanel.CalendarTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel
Enclosing class:
IstiCalendarPanel

protected static class IstiCalendarPanel.CalendarTableModel
extends javax.swing.table.AbstractTableModel

Table Model for the calendar

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
protected IstiCalendarPanel.CalendarTableModel()
           
 
Method Summary
 java.lang.Class getColumnClass(int columnIndex)
          Returns the Class of the column
 int getColumnCount()
          the max number of columns (days of the week)
protected  int getColumnIndex(int dayOfMonth)
          gets the index for the column (day of the week) for the day of the month
 java.lang.String getColumnName(int columnIndex)
          the column (day of the week) title
protected  int getDayOfMonthIndex(int dayOfMonth)
          gets the index for the day of the month
 int getRowCount()
          the max number of rows (weeks in a month)
protected  int getRowIndex(int dayOfMonth)
          gets the index for the row (week of month) for the day of the month
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          gets the day of the month specified by the row (week of month) and the column (day of the week).
 void updateData(java.util.Calendar calendar)
          update the data for change in the date
 
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
 

Constructor Detail

IstiCalendarPanel.CalendarTableModel

protected IstiCalendarPanel.CalendarTableModel()
Method Detail

updateData

public void updateData(java.util.Calendar calendar)
update the data for change in the date

Parameters:
calendar - the calendar for the date

getColumnCount

public int getColumnCount()
the max number of columns (days of the week)

Returns:
the max number of columns in the table

getRowCount

public int getRowCount()
the max number of rows (weeks in a month)

Returns:
the max number of rows in the table

getColumnName

public java.lang.String getColumnName(int columnIndex)
the column (day of the week) title

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
columnIndex - the column (day of the week)
Returns:
the max number of columns in the table

getDayOfMonthIndex

protected int getDayOfMonthIndex(int dayOfMonth)
gets the index for the day of the month

Parameters:
dayOfMonth - the day of the month
Returns:
the day of the month index

getColumnIndex

protected int getColumnIndex(int dayOfMonth)
gets the index for the column (day of the week) for the day of the month

Parameters:
dayOfMonth - the day of the month
Returns:
the column index

getRowIndex

protected int getRowIndex(int dayOfMonth)
gets the index for the row (week of month) for the day of the month

Parameters:
dayOfMonth - the day of the month
Returns:
the row index

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
gets the day of the month specified by the row (week of month) and the column (day of the week).

Parameters:
rowIndex - the row (week of month)
columnIndex - the column (day of the week)
Returns:
the day of the month

getColumnClass

public java.lang.Class getColumnClass(int columnIndex)
Returns the Class of the column

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
columnIndex - the column being queried
Returns:
the Class