Java Date Picker v3.2

com.standbysoft.component.date.swing
Class DefaultMonthModel

java.lang.Object
  extended bycom.standbysoft.component.date.swing.DefaultMonthModel
All Implemented Interfaces:
MonthModel

public class DefaultMonthModel
extends java.lang.Object
implements MonthModel

A default implementation for a MonthModel.


Field Summary
 
Fields inherited from interface com.standbysoft.component.date.swing.MonthModel
DOW_NAMES_LONG, DOW_NAMES_SHORT, MONTH_NAMES_LONG, MONTH_NAMES_SHORT
 
Constructor Summary
DefaultMonthModel()
           
DefaultMonthModel(java.util.Locale locale)
           
DefaultMonthModel(java.util.Locale locale, int dowFormat, int monthFormat)
           
DefaultMonthModel(java.util.Locale locale, int dowFirst, int dowFormat, int monthFormat)
           
 
Method Summary
 void addMonthModelListener(MonthModelListener listener)
          Adds an object that listens to changes in this model.
protected  void fireDowFirstChanged(MonthModelEvent evt)
          DefaultMonthModel subclasses must call this method when the first day of week changes.
protected  void fireDowNamesChanged(MonthModelEvent evt)
          DefaultMonthModel subclasses must call this method when the format for the days of week names changes.
protected  void fireMonthChanged(MonthModelEvent evt)
          DefaultMonthModel subclasses must call this method when the month represented by the model changes.
protected  void fireMonthNamesChanged(MonthModelEvent evt)
          DefaultMonthModel subclasses must call this method when the format for the month names changes.
 int getDowFirst()
          Returns the first day of week.
 int getDowIndex(int day)
          Returns the index of a specified day in a week.
 int getDowNamesFormat()
          Returns what format the names of days of week have.
 int[] getDows()
          Returns the days of week starting with the first day of week.
 java.util.EventListener[] getListeners(java.lang.Class listenerType)
           
 int getMonth()
          Returns the month represented by this model.
 int getMonthNamesFormat()
          Returns what format the names of months have.
 int getYear()
          Returns the year to which the represented month belongs.
 void removeMonthModelListener(MonthModelListener listener)
          Removes a specified listener from the list of registered listeners.
 void setDowFirst(int day)
          Specifies the first day of week.
 void setDowFormat(int format)
           
 void setMonth(int amonth)
          Specifies a new month to be represented by this model.
 void setMonthFormat(int format)
           
 void setYear(int ayear)
          Specifies a new year to which the represented month belongs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMonthModel

public DefaultMonthModel()

DefaultMonthModel

public DefaultMonthModel(java.util.Locale locale)

DefaultMonthModel

public DefaultMonthModel(java.util.Locale locale,
                         int dowFormat,
                         int monthFormat)

DefaultMonthModel

public DefaultMonthModel(java.util.Locale locale,
                         int dowFirst,
                         int dowFormat,
                         int monthFormat)
Method Detail

getDows

public int[] getDows()
Description copied from interface: MonthModel
Returns the days of week starting with the first day of week.

Specified by:
getDows in interface MonthModel
Returns:
the days of week in order, starting with the first day of week. The values are values like Calendar.MONDAY.
See Also:
MonthModel.getDowFirst()

getDowIndex

public int getDowIndex(int day)
Description copied from interface: MonthModel
Returns the index of a specified day in a week. The week is considered to start with the first day of week which has the index 0.

Specified by:
getDowIndex in interface MonthModel
Parameters:
day - day of week for which the index is requested. The values are values like Calendar.MONDAY.
Returns:
the index of the specified day in a week. Values are in the range 0..6.
See Also:
MonthModel.getDowFirst()

setDowFormat

public void setDowFormat(int format)

getDowNamesFormat

public int getDowNamesFormat()
Description copied from interface: MonthModel
Returns what format the names of days of week have.

Specified by:
getDowNamesFormat in interface MonthModel
Returns:
the format that the names of days of week have

setMonthFormat

public void setMonthFormat(int format)

getMonthNamesFormat

public int getMonthNamesFormat()
Description copied from interface: MonthModel
Returns what format the names of months have.

Specified by:
getMonthNamesFormat in interface MonthModel
Returns:
the format that the names of months have

setDowFirst

public void setDowFirst(int day)
Description copied from interface: MonthModel
Specifies the first day of week.

Specified by:
setDowFirst in interface MonthModel
Parameters:
day - day of week that is a java.util.Calendar constant like Calendar.MONDAY

getDowFirst

public int getDowFirst()
Description copied from interface: MonthModel
Returns the first day of week.

Specified by:
getDowFirst in interface MonthModel
Returns:
the first day of week.

setMonth

public void setMonth(int amonth)
Description copied from interface: MonthModel
Specifies a new month to be represented by this model. The month will be the month of the current year. Only months that belong to the allowed dates interval are valid.

Specified by:
setMonth in interface MonthModel
Parameters:
amonth - new month to be used by this model. The values are Calendar constants like Calendar.JANUARY.
See Also:
MonthModel.getYear()

setYear

public void setYear(int ayear)
Description copied from interface: MonthModel
Specifies a new year to which the represented month belongs. Only years that belong to the allowed dates interval are valid.

Specified by:
setYear in interface MonthModel
Parameters:
ayear - year to which the represented month belongs.

getMonth

public int getMonth()
Description copied from interface: MonthModel
Returns the month represented by this model.

Specified by:
getMonth in interface MonthModel
Returns:
month represented by this model as a Calendar constant like Calendar.JANUARY.
See Also:
MonthModel.getYear()

getYear

public int getYear()
Description copied from interface: MonthModel
Returns the year to which the represented month belongs.

Specified by:
getYear in interface MonthModel
Returns:
the year to which the represented month belongs.
See Also:
MonthModel.getMonth()

addMonthModelListener

public void addMonthModelListener(MonthModelListener listener)
Description copied from interface: MonthModel
Adds an object that listens to changes in this model.

Specified by:
addMonthModelListener in interface MonthModel
Parameters:
listener - the listener object that is informed about changes in this model

removeMonthModelListener

public void removeMonthModelListener(MonthModelListener listener)
Description copied from interface: MonthModel
Removes a specified listener from the list of registered listeners.

Specified by:
removeMonthModelListener in interface MonthModel
Parameters:
listener - the listener to be removed

getListeners

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

fireDowNamesChanged

protected void fireDowNamesChanged(MonthModelEvent evt)
DefaultMonthModel subclasses must call this method when the format for the days of week names changes.


fireDowFirstChanged

protected void fireDowFirstChanged(MonthModelEvent evt)
DefaultMonthModel subclasses must call this method when the first day of week changes.


fireMonthNamesChanged

protected void fireMonthNamesChanged(MonthModelEvent evt)
DefaultMonthModel subclasses must call this method when the format for the month names changes.


fireMonthChanged

protected void fireMonthChanged(MonthModelEvent evt)
DefaultMonthModel subclasses must call this method when the month represented by the model changes.


Java Date Picker v3.2

Visit www.javadatepicker.com for further information or send us your suggestions.

Copyright © 2003-2004 Stand By Soft Ltd. All Rights Reserved.