All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tea.set.YearCal

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----tea.set.Grid
                                   |
                                   +----tea.set.YearCal

public class YearCal
extends Grid
YearCal is a collection of month calendars. It can display and handle any month range, even across years. Highlight of date and date range is also supported. It uses MCalendar class to draw individual month calendar. Since YearCal uses tea.set.Grid to manage the months calendars, all Grid layout options are supported.

YearCal supports the following properties:
Property NameProperty TypeDescription
Titleint Title option, same as MCalendar.
Yearint Calendar year.
StartYearint Starting Year of the selected days.
startMonthint Starting month of the selected days.
StartDayint Starting day of the selected days.
EndYearint Ending Year of the selected days.
startMonthint Ending month of the selected days.
EndDayint Ending day of the selected days.
HighlightColor (Writeonly) Highlighting color.

YearCal generates the following events:
Event TypeEvent IDGenerated Description
ActionEventActionEvent.ACTION_PERFORMED Day range selected. ActionEvent.getActionCommand() contains "select".

See Also:
MCalendar

Constructor Index

 o YearCal()
Create a yearly calendar for the current year.
 o YearCal(int)
Create a yearly calendar for year y.
 o YearCal(int, int)
Create a yearly calendar for the current year with month calendars in row and col grid.
 o YearCal(int, int, int)
Create a yearly calendar for year y with month calendars in row and col grid.
 o YearCal(int, int, int, int, int, int)
Create a calendar for months between m1/y1 and m2/y2.

Method Index

 o addActionListener(ActionListener)
Add an action listener.
 o clear()
Clears all selections.
 o dehighlight(int, int, int)
Highlight the specified day.
 o dehighlight(int, int, int, int, int, int)
Highlight the day range.
 o getEndDay()
Get the end day of the selected day range.
 o getEndMonth()
Get the end month of the selected day range.
 o getEndYear()
Get the start year of the selected day range.
 o getStartDay()
Get the start day of the selected day range.
 o getStartMonth()
Get the start month of the selected day range.
 o getStartYear()
Get the start year of the selected day range.
 o getTitle()
Get the monthly title option.
 o highlight(int, int, int)
Highlight the specified day.
 o highlight(int, int, int, int, int, int)
Highlight the day range.
 o isHighlighted(int, int, int)
Return true if the specified day is highlighted.
 o processActionEvent(ActionEvent)
Process and dispatch action event.
 o removeActionListener(ActionListener)
Remove an action listener.
 o select(int, int, int, int, int, int)
Select the day range.
 o setHighlight(Color)
Set the highlight color.
 o setTitle(int)
Set the title options of calendar.
 o setYear(int)
Set the year to y.

Constructors

 o YearCal
 public YearCal()
Create a yearly calendar for the current year.

 o YearCal
 public YearCal(int row,
                int col)
Create a yearly calendar for the current year with month calendars in row and col grid.

Parameters:
number - of rows.
number - of columns.
 o YearCal
 public YearCal(int y)
Create a yearly calendar for year y.

Parameters:
y - calendar year, year number minus 1900.
 o YearCal
 public YearCal(int y,
                int row,
                int col)
Create a yearly calendar for year y with month calendars in row and col grid.

Parameters:
y - calendar year, year number minus 1900.
number - of rows.
number - of columns.
 o YearCal
 public YearCal(int y1,
                int m1,
                int y2,
                int m2,
                int row,
                int col)
Create a calendar for months between m1/y1 and m2/y2. Draw row rows of month calendars and col months per row.

Parameters:
y1 - starting calendar year, year number minus 1900.
m1 - starting calendar month, starts from 0.
y2 - ending calendar year, year number minus 1900.
m2 - ending calendar month, starts from 0.
number - of rows.
number - of columns.

Methods

 o setTitle
 public synchronized void setTitle(int flag)
Set the title options of calendar. See MCalendar to find out valid flags.

Parameters:
flag - title option flag.
 o getTitle
 public int getTitle()
Get the monthly title option.

Returns:
monthly title option.
 o setYear
 public synchronized void setYear(int y)
Set the year to y. This only applies to the case where all months are in same year.

Parameters:
y - calendar year, year number minus 1900.
 o getStartYear
 public int getStartYear()
Get the start year of the selected day range. If only one day is selected, the start year/month/day is the same as the end year/month/day.

Returns:
starting calendar year of a selected range.
 o getStartMonth
 public int getStartMonth()
Get the start month of the selected day range. If only one day is selected, the start month/day is the same as the end month/day.

Returns:
starting calendar month of a selected range.
 o getStartDay
 public int getStartDay()
Get the start day of the selected day range.

Returns:
starting day of a selected range.
 o getEndYear
 public int getEndYear()
Get the start year of the selected day range. If only one day is selected, the start year/month/day is the same as the end year/month/day.

Returns:
ending calendar year of a selected range.
 o getEndMonth
 public int getEndMonth()
Get the end month of the selected day range.

Returns:
ending calendar month of a selected range.
 o getEndDay
 public int getEndDay()
Get the end day of the selected day range.

Returns:
ending day of a selected range.
 o highlight
 public void highlight(int y,
                       int m,
                       int d)
Highlight the specified day.

Parameters:
y - calendar year, year number minus 1900.
m - calendar month, starts from 0.
d - day, starts from 1.
 o highlight
 public synchronized void highlight(int sy,
                                    int sm,
                                    int sd,
                                    int ey,
                                    int em,
                                    int ed)
Highlight the day range.

Parameters:
sy - starting year.
sm - starting month.
sd - starting day.
ey - ending year.
em - ending month.
ed - ending day.
 o dehighlight
 public void dehighlight(int y,
                         int m,
                         int d)
Highlight the specified day.

Parameters:
y - calendar year, year number minus 1900.
m - calendar month, starts from 0.
d - day, starts from 1.
 o dehighlight
 public void dehighlight(int sy,
                         int sm,
                         int sd,
                         int ey,
                         int em,
                         int ed)
Highlight the day range.

Parameters:
sy - starting year.
sm - starting month.
sd - starting day.
ey - ending year.
em - ending month.
ed - ending day.
 o isHighlighted
 public boolean isHighlighted(int y,
                              int m,
                              int d)
Return true if the specified day is highlighted.

Parameters:
y - calendar year, year number minus 1900.
m - calendar month, starts from 0.
d - day, starts from 1.
Returns:
true if specified day is highlighted.
 o setHighlight
 public void setHighlight(Color c)
Set the highlight color. Defaults to red.

Parameters:
c - highlight color.
 o select
 public void select(int sy,
                    int sm,
                    int sd,
                    int ey,
                    int em,
                    int ed)
Select the day range.

Parameters:
sy - starting year.
sm - starting month.
sd - starting day.
ey - ending year.
em - ending month.
ed - ending day.
 o clear
 public void clear()
Clears all selections.

 o addActionListener
 public void addActionListener(ActionListener listener)
Add an action listener.

Parameters:
listener - action listener.
 o removeActionListener
 public void removeActionListener(ActionListener listener)
Remove an action listener.

Parameters:
listener - action listener.
 o processActionEvent
 public void processActionEvent(ActionEvent e)
Process and dispatch action event.

Parameters:
e - action event.

All Packages  Class Hierarchy  This Package  Previous  Next  Index