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 Name | Property Type | Description |
Title | int |
Title option, same as MCalendar. |
Year | int |
Calendar year. |
StartYear | int |
Starting Year of the selected days. |
startMonth | int |
Starting month of the selected days. |
StartDay | int |
Starting day of the selected days. |
EndYear | int |
Ending Year of the selected days. |
startMonth | int |
Ending month of the selected days. |
EndDay | int |
Ending day of the selected days. |
Highlight | Color (Writeonly) |
Highlighting color. |
YearCal generates the following events:
Event Type | Event ID | Generated |
Description |
ActionEvent | ActionEvent.ACTION_PERFORMED |
Day range selected. |
ActionEvent.getActionCommand() contains "select". |
- See Also:
- MCalendar
-
YearCal()
- Create a yearly calendar for the current year.
-
YearCal(int)
- Create a yearly calendar for year y.
-
YearCal(int, int)
- Create a yearly calendar for the current year with month calendars
in row and col grid.
-
YearCal(int, int, int)
- Create a yearly calendar for year y with month calendars
in row and col grid.
-
YearCal(int, int, int, int, int, int)
- Create a calendar for months between m1/y1 and m2/y2.
-
addActionListener(ActionListener)
- Add an action listener.
-
clear()
- Clears all selections.
-
dehighlight(int, int, int)
- Highlight the specified day.
-
dehighlight(int, int, int, int, int, int)
- Highlight the day range.
-
getEndDay()
- Get the end day of the selected day range.
-
getEndMonth()
- Get the end month of the selected day range.
-
getEndYear()
- Get the start year of the selected day range.
-
getStartDay()
- Get the start day of the selected day range.
-
getStartMonth()
- Get the start month of the selected day range.
-
getStartYear()
- Get the start year of the selected day range.
-
getTitle()
- Get the monthly title option.
-
highlight(int, int, int)
- Highlight the specified day.
-
highlight(int, int, int, int, int, int)
- Highlight the day range.
-
isHighlighted(int, int, int)
- Return true if the specified day is highlighted.
-
processActionEvent(ActionEvent)
- Process and dispatch action event.
-
removeActionListener(ActionListener)
- Remove an action listener.
-
select(int, int, int, int, int, int)
- Select the day range.
-
setHighlight(Color)
- Set the highlight color.
-
setTitle(int)
- Set the title options of calendar.
-
setYear(int)
- Set the year to y.
YearCal
public YearCal()
- Create a yearly calendar for the current year.
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.
YearCal
public YearCal(int y)
- Create a yearly calendar for year y.
- Parameters:
- y - calendar year, year number minus 1900.
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.
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.
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.
getTitle
public int getTitle()
- Get the monthly title option.
- Returns:
- monthly title option.
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.
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.
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.
getStartDay
public int getStartDay()
- Get the start day of the selected day range.
- Returns:
- starting day of a selected range.
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.
getEndMonth
public int getEndMonth()
- Get the end month of the selected day range.
- Returns:
- ending calendar month of a selected range.
getEndDay
public int getEndDay()
- Get the end day of the selected day range.
- Returns:
- ending day of a selected range.
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.
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.
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.
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.
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.
setHighlight
public void setHighlight(Color c)
- Set the highlight color. Defaults to red.
- Parameters:
- c - highlight color.
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.
clear
public void clear()
- Clears all selections.
addActionListener
public void addActionListener(ActionListener listener)
- Add an action listener.
- Parameters:
- listener - action listener.
removeActionListener
public void removeActionListener(ActionListener listener)
- Remove an action listener.
- Parameters:
- listener - action listener.
processActionEvent
public void processActionEvent(ActionEvent e)
- Process and dispatch action event.
- Parameters:
- e - action event.
All Packages Class Hierarchy This Package Previous Next Index