|
JDatePicker v4.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A month model is a helper interface that lets you control different settings
for a JMonth component. The idea of
this interface is to have a single point of control for various month aspects.
It can:
WeekModel,
JMonth| Method Summary | |
void |
addMonthModelListener(MonthModelListener listener)
Adds an object that listens to changes in this model. |
int |
getMonth()
Returns the month represented by this model. |
java.lang.String[] |
getMonthNames()
Determines the names of the months. |
java.util.TimeZone |
getTimeZone()
Returns the time zone used to determine whether a date belongs to the month represented by this model or not. |
java.util.Date |
getToday()
Returns the today reference date. |
int |
getYear()
Returns the year to which the represented month belongs. |
boolean |
isToday(java.util.Date date)
Determines whether a specified date matches the today date (the year, month and date fields in fact). |
boolean |
isTrailingNext(java.util.Date date)
Determines if a specified date belongs to a following month. |
boolean |
isTrailingPrevious(java.util.Date date)
Determines if a specified date belongs to a previous month. |
void |
removeMonthModelListener(MonthModelListener listener)
Removes a specified listener from the list of registered listeners. |
void |
setMonth(int month)
Specifies a new month to be represented by this model. |
void |
setMonth(int month,
int year)
Specifies a new month to be represented by this model. |
void |
setTimeZone(java.util.TimeZone timezone)
Specifies the time zone used to determine whether a date belongs to the month represented by this model or not. |
void |
setToday(java.util.Date date)
Specifies a new date to be considered the today date. |
void |
setYear(int year)
Specifies a new year to which the represented month belongs. |
| Method Detail |
public void addMonthModelListener(MonthModelListener listener)
listener - the listener object that is informed about changes in this modelpublic void removeMonthModelListener(MonthModelListener listener)
listener - the listener to be removedpublic java.lang.String[] getMonthNames()
Calendar id of the respective
month. For instance to get the name for January, you should do something like:
String[] names = model.getMonthNames(); String jan = names[Calendar.JANUARY];
public int getMonth()
Calendar constant
like Calendar.JANUARY.getYear()public int getYear()
getMonth()public void setMonth(int month)
month - new month to be used by this model. The values are
Calendar constants like Calendar.JANUARY.getYear(),
setMonth(int, int)public void setYear(int year)
year - year to which the represented month belongs.setMonth(int, int)
public void setMonth(int month,
int year)
month - new month to be used by this model. The values are
Calendar constants like Calendar.JANUARYyear - year to which the represented month belongssetMonth(int),
setYear(int)public boolean isTrailingNext(java.util.Date date)
date - date that is tested if it is after this month
true if the date is after the last date of this
month; false otherwise.public boolean isTrailingPrevious(java.util.Date date)
date - date that is tested if it is previous to this month
true if the date is before the first date of this
month; false otherwise.public boolean isToday(java.util.Date date)
date - date that is tested
true if the date matches the today date;
false otherwise.public void setToday(java.util.Date date)
Specifies a new date to be considered the today date. This date is
particularly important for the date renderer and the
JMonthView component which uses a label to display the today
date.
Although setting the today date might seem a little weird, it makes
sense if the application runs for a few days. Specifying the today date
might be done automatically by a timer thread. In fact, JMonth
uses such a thread to do it automatically.
When the today date changes, all interested listeners are notified via
a MonthModelListener.todayChanged(MonthModelEvent) event.
date - new date that will be the today referenceisToday(Date)public java.util.Date getToday()
setToday(Date)public void setTimeZone(java.util.TimeZone timezone)
timezone - new time zonepublic java.util.TimeZone getTimeZone()
setTimeZone(TimeZone)
|
JDatePicker v4.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Visit www.jdatepicker.com for further information or send us your suggestions.
Copyright © 2003-2007 Stand By Soft Ltd. All Rights Reserved.