JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.calendar
Class DayTable.DayModel

java.lang.Object
  |
  +--com.klg.jclass.util.calendar.DayTable.DayModel
All Implemented Interfaces:
EventListener, JCValueListener, Serializable, TableModel
Enclosing class:
DayTable

protected class DayTable.DayModel
extends Object
implements TableModel, JCValueListener, Serializable

Build data model wrapper around DateSymbols that builds a 7x6 table of month with the current date for picking.

See Also:
Serialized Form

Field Summary
protected  com.klg.jclass.util.JCListenerList tableListeners
           
 
Constructor Summary
DayTable.DayModel(Locale l)
          Construct a DayModel with a certain locale.
 
Method Summary
 void addTableModelListener(TableModelListener l)
          Add a table listener to the model.
protected  Calendar copyCalendar(Calendar cal)
          Return a copy of the calender.
 Class getColumnClass(int columnIndex)
          Get the class of a particular column.
 int getColumnCount()
          Get the number of columns.
 String getColumnName(int columnIndex)
          Get the name of a particular column.
 int getRowCount()
          Get the number of rows.
 Object getValueAt(int rowIndex, int columnIndex)
          Return the value at the given row and column.
 boolean isCellEditable(int rowIndex, int columnIndex)
          Test to see if the cell is editable.
 void removeTableModelListener(TableModelListener l)
          Remove a table listener from the model.
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
          Set the value at the given row and column.
 void valueChanged(com.klg.jclass.util.value.JCValueEvent event)
          The method informs the listener that the value has been changed.
 void valueChanging(com.klg.jclass.util.value.JCValueEvent event)
          The value is changing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableListeners

protected com.klg.jclass.util.JCListenerList tableListeners
Constructor Detail

DayTable.DayModel

public DayTable.DayModel(Locale l)
Construct a DayModel with a certain locale.

Parameters:
l - The locale from which the short weekday names is garnered
Method Detail

getRowCount

public int getRowCount()
Get the number of rows.

Specified by:
getRowCount in interface TableModel
Returns:
The current number of rows

getColumnCount

public int getColumnCount()
Get the number of columns.

Specified by:
getColumnCount in interface TableModel
Returns:
The current number of columns

getColumnName

public String getColumnName(int columnIndex)
Get the name of a particular column.

Specified by:
getColumnName in interface TableModel
Parameters:
columnIndex - The index of column whose name is required
Returns:
The column name of the given column

getColumnClass

public Class getColumnClass(int columnIndex)
Get the class of a particular column.

Specified by:
getColumnClass in interface TableModel
Parameters:
columnIndex - The index of column whose class type is required
Returns:
The class type of the given column

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Test to see if the cell is editable.

Specified by:
isCellEditable in interface TableModel
Parameters:
rowIndex - The row index of the cell
columnIndex - The column index of the cell
Returns:
false as all cells are not editable

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Return the value at the given row and column.

Specified by:
getValueAt in interface TableModel
Parameters:
rowIndex - The row index of the cell
columnIndex - The column index of the cell
Returns:
The value for the given row and column indices

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Set the value at the given row and column. Since cells are readonly this method always throws an exception.

Specified by:
setValueAt in interface TableModel
Parameters:
aValue - The value to be set
rowIndex - The row index of the cell
columnIndex - The column index of the cell
Throws:
IllegalArgumentException

addTableModelListener

public void addTableModelListener(TableModelListener l)
Add a table listener to the model.

Specified by:
addTableModelListener in interface TableModel
Parameters:
l - The table model listener to be added

removeTableModelListener

public void removeTableModelListener(TableModelListener l)
Remove a table listener from the model.

Specified by:
removeTableModelListener in interface TableModel
Parameters:
l - The table model listener to be removed

copyCalendar

protected Calendar copyCalendar(Calendar cal)
Return a copy of the calender.

Parameters:
cal - The calendar to be copied
Returns:
The new replica calendar

valueChanging

public void valueChanging(com.klg.jclass.util.value.JCValueEvent event)
The value is changing. The listener may further change the new_value or abort the change altogether. If the case of an abort (call event.setAllowChange(false)) the "valueChanged" method will never be called.

Specified by:
valueChanging in interface JCValueListener
Parameters:
event - The event generated by the value changing

valueChanged

public void valueChanged(com.klg.jclass.util.value.JCValueEvent event)
The method informs the listener that the value has been changed.

Specified by:
valueChanged in interface JCValueListener
Parameters:
event - The event generated by the value being changed

Copyright © 2004 Quest Software Inc..
All rights reserved.