Java Date Picker v2.0.0

com.standbysoft.datepicker
Class DefaultDateSelectionModel

java.lang.Object
  |
  +--com.standbysoft.datepicker.DefaultDateSelectionModel
All Implemented Interfaces:
DateSelectionModel

public class DefaultDateSelectionModel
extends java.lang.Object
implements DateSelectionModel

A default implementation of a date selection model.

Author:
Nicolae Cismaru

Inner classes inherited from class com.standbysoft.datepicker.DateSelectionModel
DateSelectionModel.SelectionMode
 
Constructor Summary
DefaultDateSelectionModel()
          Creates a default selection model.
 
Method Summary
 void addDateSelectionInterval(java.util.Date date1, java.util.Date date2)
          Change the selection to be the set union of the current date selection and the dates between date1 and date2 inclusive.
 void addDateSelectionListener(DateSelectionListener listener)
          Registers a new date selection listener to the model.
 void addDisabled(java.util.Date date)
           
 java.util.Date getAnchorSelectionDate()
          Returns the anchor selection date.
 java.util.Date getLeadSelectionDate()
          Returns the lead selection date.
 java.util.EventListener[] getListeners(java.lang.Class listenerType)
           
 java.util.Date[] getSelectedDates()
          Returns the selected dates.
 com.standbysoft.datepicker.SelectionMode getSelectionMode()
          Returns the selection mode used by this model.
 boolean isDateSelected(java.util.Date date)
          Determines whether a specified date has been selected.
 boolean isDisabled(java.util.Date date)
          Returns false because all the days from the calendar can be selected by default.
 void removeAllDisabled()
           
 void removeDateSelectionInterval(java.util.Date date1, java.util.Date date2)
          Change the selection to be the set difference of the current selection and the dates between date1 and date2 inclusive.
 void removeDateSelectionListener(DateSelectionListener listener)
          Removes a specified date selection listener from this model.
 void removeDisabled(java.util.Date date)
           
 void setAnchorSelectionDate(java.util.Date date)
          Sets the anchor selection date.
 void setDateSelectionIterval(java.util.Date date1, java.util.Date date2)
          Changes the date selection interval to be between date1 and date2 inclusive.
 void setLeadSelectionDate(java.util.Date date)
          Sets the lead selection date.
 void setSelectionMode(com.standbysoft.datepicker.SelectionMode mode)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.standbysoft.datepicker.DateSelectionModel
setSelectionMode
 

Constructor Detail

DefaultDateSelectionModel

public DefaultDateSelectionModel()
Creates a default selection model.
Method Detail

isDisabled

public boolean isDisabled(java.util.Date date)
Returns false because all the days from the calendar can be selected by default.
Specified by:
isDisabled in interface DateSelectionModel
Parameters:
date - date to be tested if disabled
Returns:
false.

addDisabled

public void addDisabled(java.util.Date date)

removeDisabled

public void removeDisabled(java.util.Date date)

removeAllDisabled

public void removeAllDisabled()

isDateSelected

public boolean isDateSelected(java.util.Date date)
Description copied from interface: DateSelectionModel
Determines whether a specified date has been selected.
Specified by:
isDateSelected in interface DateSelectionModel
Following copied from interface: com.standbysoft.datepicker.DateSelectionModel
Parameters:
date - date to be tested
Returns:
true if the date has been selected; false otherwise.

setSelectionMode

public void setSelectionMode(com.standbysoft.datepicker.SelectionMode mode)

getSelectionMode

public com.standbysoft.datepicker.SelectionMode getSelectionMode()
Description copied from interface: DateSelectionModel
Returns the selection mode used by this model.
Specified by:
getSelectionMode in interface DateSelectionModel
Following copied from interface: com.standbysoft.datepicker.DateSelectionModel
Returns:
the selection mode used by this model.

getSelectedDates

public java.util.Date[] getSelectedDates()
Description copied from interface: DateSelectionModel
Returns the selected dates. Depending on the selection mode, one or more dates are returned.
Specified by:
getSelectedDates in interface DateSelectionModel
Following copied from interface: com.standbysoft.datepicker.DateSelectionModel
Returns:
the selected dates.
See Also:
DateSelectionModel.SelectionMode

setLeadSelectionDate

public void setLeadSelectionDate(java.util.Date date)
Description copied from interface: DateSelectionModel
Sets the lead selection date. The lead selection date is the second selected date. If only one date is selected then it corresponds to that date.
Specified by:
setLeadSelectionDate in interface DateSelectionModel
Following copied from interface: com.standbysoft.datepicker.DateSelectionModel
Parameters:
date - lead date to be set
See Also:
DateSelectionModel.getLeadSelectionDate()

getLeadSelectionDate

public java.util.Date getLeadSelectionDate()
Description copied from interface: DateSelectionModel
Returns the lead selection date.
Specified by:
getLeadSelectionDate in interface DateSelectionModel
Following copied from interface: com.standbysoft.datepicker.DateSelectionModel
Returns:
the lead selection date.

setAnchorSelectionDate

public void setAnchorSelectionDate(java.util.Date date)
Description copied from interface: DateSelectionModel
Sets the anchor selection date. The anchor selection date is the second selected date. If only one date is selected then it corresponds to that date.
Specified by:
setAnchorSelectionDate in interface DateSelectionModel
Following copied from interface: com.standbysoft.datepicker.DateSelectionModel
Parameters:
date - anchor date to be set
See Also:
DateSelectionModel.getAnchorSelectionDate()

getAnchorSelectionDate

public java.util.Date getAnchorSelectionDate()
Description copied from interface: DateSelectionModel
Returns the anchor selection date.
Specified by:
getAnchorSelectionDate in interface DateSelectionModel
Following copied from interface: com.standbysoft.datepicker.DateSelectionModel
Returns:
the anchor selection date.

setDateSelectionIterval

public void setDateSelectionIterval(java.util.Date date1,
                                    java.util.Date date2)
Description copied from interface: DateSelectionModel
Changes the date selection interval to be between date1 and date2 inclusive. If this represents a change to the current date selection, then notify each DateSelectionListener. Note that date1 doesn't have to be less than or equal to date2.
Specified by:
setDateSelectionIterval in interface DateSelectionModel
Following copied from interface: com.standbysoft.datepicker.DateSelectionModel
Parameters:
date1 - one end of the date interval
date2 - other end of the date interval

addDateSelectionInterval

public void addDateSelectionInterval(java.util.Date date1,
                                     java.util.Date date2)
Description copied from interface: DateSelectionModel
Change the selection to be the set union of the current date selection and the dates between date1 and date2 inclusive. If this represents a change to the current date selection, then notify each DateSelectionListener. Note that date1 doesn't have to be less than or equal to date2.
Specified by:
addDateSelectionInterval in interface DateSelectionModel
Following copied from interface: com.standbysoft.datepicker.DateSelectionModel
Parameters:
date1 - one end of the date interval
date2 - other end of the date interval

removeDateSelectionInterval

public void removeDateSelectionInterval(java.util.Date date1,
                                        java.util.Date date2)
Description copied from interface: DateSelectionModel
Change the selection to be the set difference of the current selection and the dates between date1 and date2 inclusive. If this represents a change to the current date selection, then notify each DateSelectionListener. Note that date1 doesn't have to be less than or equal to date2.
Specified by:
removeDateSelectionInterval in interface DateSelectionModel
Following copied from interface: com.standbysoft.datepicker.DateSelectionModel
Parameters:
date1 - one end of the date interval
date2 - other end of the date interval

addDateSelectionListener

public void addDateSelectionListener(DateSelectionListener listener)
Description copied from interface: DateSelectionModel
Registers a new date selection listener to the model.
Specified by:
addDateSelectionListener in interface DateSelectionModel
Following copied from interface: com.standbysoft.datepicker.DateSelectionModel
Parameters:
listener - listener to be registered

removeDateSelectionListener

public void removeDateSelectionListener(DateSelectionListener listener)
Description copied from interface: DateSelectionModel
Removes a specified date selection listener from this model.
Specified by:
removeDateSelectionListener in interface DateSelectionModel
Following copied from interface: com.standbysoft.datepicker.DateSelectionModel
Parameters:
listener - listener to be removed

getListeners

public java.util.EventListener[] getListeners(java.lang.Class listenerType)

Java Date Picker v2.0.0

Copyright © 2003 Standby Soft Ltd. All Rights Reserved.