Java Date Picker v3.2

com.standbysoft.component.date.swing
Interface MonthModel

All Known Implementing Classes:
DefaultMonthModel

public interface MonthModel

This interface defines the methods components like JMonth use to display the days of a month. The model can be used to find things like:


Field Summary
static int DOW_NAMES_LONG
          Type value indicating that the days of week names are long.
static int DOW_NAMES_SHORT
          Type value indicating that the days of week names are short.
static int MONTH_NAMES_LONG
          Type value indicating that the months' names are long.
static int MONTH_NAMES_SHORT
          Type value indicating that the months' names are short.
 
Method Summary
 void addMonthModelListener(MonthModelListener listener)
          Adds an object that listens to changes in this model.
 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.
 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 setMonth(int month)
          Specifies a new month to be represented by this model.
 void setYear(int year)
          Specifies a new year to which the represented month belongs.
 

Field Detail

DOW_NAMES_SHORT

public static final int DOW_NAMES_SHORT
Type value indicating that the days of week names are short.

See Also:
Constant Field Values

DOW_NAMES_LONG

public static final int DOW_NAMES_LONG
Type value indicating that the days of week names are long.

See Also:
Constant Field Values

MONTH_NAMES_SHORT

public static final int MONTH_NAMES_SHORT
Type value indicating that the months' names are short.

See Also:
Constant Field Values

MONTH_NAMES_LONG

public static final int MONTH_NAMES_LONG
Type value indicating that the months' names are long.

See Also:
Constant Field Values
Method Detail

addMonthModelListener

public void addMonthModelListener(MonthModelListener listener)
Adds an object that listens to changes in this model.

Parameters:
listener - the listener object that is informed about changes in this model

removeMonthModelListener

public void removeMonthModelListener(MonthModelListener listener)
Removes a specified listener from the list of registered listeners.

Parameters:
listener - the listener to be removed

getDowNamesFormat

public int getDowNamesFormat()
Returns what format the names of days of week have.

Returns:
the format that the names of days of week have

getMonthNamesFormat

public int getMonthNamesFormat()
Returns what format the names of months have.

Returns:
the format that the names of months have

getDowFirst

public int getDowFirst()
Returns the first day of week.

Returns:
the first day of week.

setDowFirst

public void setDowFirst(int day)
Specifies the first day of week.

Parameters:
day - day of week that is a java.util.Calendar constant like Calendar.MONDAY

getDows

public int[] getDows()
Returns the days of week starting with the first day of week.

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

getDowIndex

public int getDowIndex(int day)
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.

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:
getDowFirst()

getMonth

public int getMonth()
Returns the month represented by this model.

Returns:
month represented by this model as a Calendar constant like Calendar.JANUARY.
See Also:
getYear()

getYear

public int getYear()
Returns the year to which the represented month belongs.

Returns:
the year to which the represented month belongs.
See Also:
getMonth()

setMonth

public void setMonth(int month)
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.

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

setYear

public void setYear(int year)
Specifies a new year to which the represented month belongs. Only years that belong to the allowed dates interval are valid.

Parameters:
year - year to which the represented month belongs.

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.