Java Date Picker v2.0.0

com.standbysoft.datepicker
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.
 java.util.Date getMaximumAllowed()
          Returns the maximum allowed date that can be represented by this model.
 java.util.Date getMinimumAllowed()
          Returns the minimum allowed date that can be represented by this model.
 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.
 boolean isMonthInRange(int month, int year)
          Determines whether a specified month is in the allowed date range.
 void removeMonthModelListener(MonthModelListener listener)
          Removes a specified listener from the list of registered listeners.
 void rollMonth(boolean up)
          Rolls one month up or down.
 void rollYear(boolean up)
          Rolls one year up or down.
 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.

DOW_NAMES_LONG

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

MONTH_NAMES_SHORT

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

MONTH_NAMES_LONG

public static final int MONTH_NAMES_LONG
Type value indicating that the months' names are long.
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()

getMinimumAllowed

public java.util.Date getMinimumAllowed()
Returns the minimum allowed date that can be represented by this model. Months below this minimum date cannot be represented by this model. If the minimum allowed date is null then there is no restriction.
Returns:
the minimum allowed date that can be represented by this model or null.

getMaximumAllowed

public java.util.Date getMaximumAllowed()
Returns the maximum allowed date that can be represented by this model. Months after this maximum date cannot be represented by this model. If the maximum allowed date is null then there is no restriction.
Returns:
the maximum allowed date that can be represented by this model or null.

isMonthInRange

public boolean isMonthInRange(int month,
                              int year)
Determines whether a specified month is in the allowed date range.
Parameters:
month - month that is tested
year - year to which the month belongs
Returns:
true if the secified month is in the allowed date range or false otherwise.

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.

rollMonth

public void rollMonth(boolean up)
Rolls one month up or down.
Parameters:
up - true if the month is rolled up and false if the month is rolled down

rollYear

public void rollYear(boolean up)
Rolls one year up or down. If this operation leads to a month that is out of range then the border month is selected.
Parameters:
up - true if the year is rolled up and false if the year is rolled down

Java Date Picker v2.0.0

Copyright © 2003 Standby Soft Ltd. All Rights Reserved.