echopointng.model
Class DefaultCalendarSelectionModel

java.lang.Object
  extended by echopointng.model.DefaultCalendarSelectionModel
All Implemented Interfaces:
CalendarSelectionModel, java.io.Serializable

public class DefaultCalendarSelectionModel
extends java.lang.Object
implements CalendarSelectionModel, java.io.Serializable

A generic implementation of CalendarSelectionModel.

See Also:
Serialized Form

Field Summary
protected  EventListenerList listenerList
           
 
Constructor Summary
DefaultCalendarSelectionModel(java.util.Calendar cal)
          The creates a CalendarSelectionModel where selectedDate to set to cal and displayedDate is set to the first day of the month of cal.
 
Method Summary
 void addListener(CalendarSelectionListener l)
          Adds a ChangeListener to the model.
 java.util.Calendar getDisplayedDate()
           
 java.util.Calendar getSelectedDate()
           
 void removeListener(CalendarSelectionListener l)
          Removes a CalendarSelectionListener from the model.
 void setDates(java.util.Calendar newSelectedDate, java.util.Calendar newDisplayedDate)
          This is the equivalent of calling setSelectedDate and setDisplayedDate except it only raises change events after the both have been set.
 void setDisplayedDate(java.util.Calendar cal)
          Sets the model's displayed date to cal .
 void setSelectedDate(java.util.Calendar cal)
          Sets the model's selected date to cal .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected EventListenerList listenerList
Constructor Detail

DefaultCalendarSelectionModel

public DefaultCalendarSelectionModel(java.util.Calendar cal)
The creates a CalendarSelectionModel where selectedDate to set to cal and displayedDate is set to the first day of the month of cal.

Parameters:
cal - - the Calendar to use.
Method Detail

addListener

public void addListener(CalendarSelectionListener l)
Adds a ChangeListener to the model.

Specified by:
addListener in interface CalendarSelectionModel
Parameters:
l - The ChangeListener to be added.

getDisplayedDate

public java.util.Calendar getDisplayedDate()
Specified by:
getDisplayedDate in interface CalendarSelectionModel
Returns:
the model's displayed date

getSelectedDate

public java.util.Calendar getSelectedDate()
Specified by:
getSelectedDate in interface CalendarSelectionModel

removeListener

public void removeListener(CalendarSelectionListener l)
Removes a CalendarSelectionListener from the model.

Specified by:
removeListener in interface CalendarSelectionModel
Parameters:
l - The CalendarSelectionListener to be removed.

setDisplayedDate

public void setDisplayedDate(java.util.Calendar cal)
Sets the model's displayed date to cal . Notifies any listeners if the model changes

Specified by:
setDisplayedDate in interface CalendarSelectionModel

setSelectedDate

public void setSelectedDate(java.util.Calendar cal)
Sets the model's selected date to cal . Notifies any listeners if the model changes

Specified by:
setSelectedDate in interface CalendarSelectionModel

setDates

public void setDates(java.util.Calendar newSelectedDate,
                     java.util.Calendar newDisplayedDate)
Description copied from interface: CalendarSelectionModel
This is the equivalent of calling setSelectedDate and setDisplayedDate except it only raises change events after the both have been set.

Specified by:
setDates in interface CalendarSelectionModel
See Also:
CalendarSelectionModel.setDates(java.util.Calendar, java.util.Calendar)