Package adams.gui.chooser
Class DatePanel.InternalCalendarModel
- java.lang.Object
-
- adams.gui.chooser.DatePanel.InternalCalendarModel
-
- All Implemented Interfaces:
EventListener
,ChangeListener
,SpinnerModel
,TableModel
- Enclosing class:
- DatePanel
protected class DatePanel.InternalCalendarModel extends Object implements TableModel, SpinnerModel, ChangeListener
This model represents the selected date. The model implements the TableModel interface for displaying days, and it implements the SpinnerModel for the year.- Author:
- Juan Heyns
-
-
Field Summary
Fields Modifier and Type Field Description protected org.jdatepicker.DateModel<?>
model
protected HashSet<ChangeListener>
spinnerChangeListeners
protected HashSet<TableModelListener>
tableModelListeners
-
Constructor Summary
Constructors Constructor Description InternalCalendarModel(org.jdatepicker.DateModel<?> model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChangeListener(ChangeListener arg0)
Part of SpinnerModel, yearvoid
addTableModelListener(TableModelListener arg0)
Part of TableModel, dayprotected void
fireValueChanged()
Called whenever a change is made to the model value.Class
getColumnClass(int arg0)
Part of TableModel, dayint
getColumnCount()
Part of TableModel, dayString
getColumnName(int arg0)
Part of TableModel, dayorg.jdatepicker.DateModel<?>
getModel()
Object
getNextValue()
Part of SpinnerModel, yearObject
getPreviousValue()
Part of SpinnerModel, yearint
getRowCount()
Part of TableModel, dayObject
getValue()
Part of SpinnerModel, yearObject
getValueAt(int arg0, int arg1)
Part of TableModel, dayboolean
isCellEditable(int arg0, int arg1)
Part of TableModel, dayvoid
removeChangeListener(ChangeListener arg0)
Part of SpinnerModel, yearvoid
removeTableModelListener(TableModelListener arg0)
Part of TableModel, dayvoid
setValue(Object text)
Part of SpinnerModel, yearvoid
setValueAt(Object arg0, int arg1, int arg2)
Part of TableModel, dayvoid
stateChanged(ChangeEvent e)
The model has changed and needs to notify the InternalModel.
-
-
-
Field Detail
-
model
protected org.jdatepicker.DateModel<?> model
-
spinnerChangeListeners
protected HashSet<ChangeListener> spinnerChangeListeners
-
tableModelListeners
protected HashSet<TableModelListener> tableModelListeners
-
-
Method Detail
-
getModel
public org.jdatepicker.DateModel<?> getModel()
-
addChangeListener
public void addChangeListener(ChangeListener arg0)
Part of SpinnerModel, year- Specified by:
addChangeListener
in interfaceSpinnerModel
-
removeChangeListener
public void removeChangeListener(ChangeListener arg0)
Part of SpinnerModel, year- Specified by:
removeChangeListener
in interfaceSpinnerModel
-
getNextValue
public Object getNextValue()
Part of SpinnerModel, year- Specified by:
getNextValue
in interfaceSpinnerModel
-
getPreviousValue
public Object getPreviousValue()
Part of SpinnerModel, year- Specified by:
getPreviousValue
in interfaceSpinnerModel
-
setValue
public void setValue(Object text)
Part of SpinnerModel, year- Specified by:
setValue
in interfaceSpinnerModel
-
getValue
public Object getValue()
Part of SpinnerModel, year- Specified by:
getValue
in interfaceSpinnerModel
-
addTableModelListener
public void addTableModelListener(TableModelListener arg0)
Part of TableModel, day- Specified by:
addTableModelListener
in interfaceTableModel
-
removeTableModelListener
public void removeTableModelListener(TableModelListener arg0)
Part of TableModel, day- Specified by:
removeTableModelListener
in interfaceTableModel
-
getColumnCount
public int getColumnCount()
Part of TableModel, day- Specified by:
getColumnCount
in interfaceTableModel
-
getColumnName
public String getColumnName(int arg0)
Part of TableModel, day- Specified by:
getColumnName
in interfaceTableModel
-
getColumnClass
public Class getColumnClass(int arg0)
Part of TableModel, day- Specified by:
getColumnClass
in interfaceTableModel
-
getRowCount
public int getRowCount()
Part of TableModel, day- Specified by:
getRowCount
in interfaceTableModel
-
getValueAt
public Object getValueAt(int arg0, int arg1)
Part of TableModel, day- Specified by:
getValueAt
in interfaceTableModel
-
isCellEditable
public boolean isCellEditable(int arg0, int arg1)
Part of TableModel, day- Specified by:
isCellEditable
in interfaceTableModel
-
setValueAt
public void setValueAt(Object arg0, int arg1, int arg2)
Part of TableModel, day- Specified by:
setValueAt
in interfaceTableModel
-
fireValueChanged
protected void fireValueChanged()
Called whenever a change is made to the model value. Notify the internal listeners and update the simple controls. Also notifies the (external) ChangeListeners of the component, since the internal state has changed.
-
stateChanged
public void stateChanged(ChangeEvent e)
The model has changed and needs to notify the InternalModel.- Specified by:
stateChanged
in interfaceChangeListener
-
-