Class tea.set.YearCal
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 Calendar class to draw individual month calendar. Since
YearCal uses tea.set.Grid to manage the months calendars, all
Grid layout options are supported.
- See Also:
- Calendar
-
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.
-
action(Event, Object)
- Action is triggered when a day or a range is selected.
-
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.
-
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.
-
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 void setTitle(int flag)
- Set the title options of calendar. See Calendar to find out
valid flags.
- Parameters:
- flag - title option flag.
setYear
public 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 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.
action
public boolean action(Event e,
Object o)
- Action is triggered when a day or a range is selected. Argument
object points to the month Calendar where the action occured.
- Parameters:
- e - event object.
- o - event argument object.
- Overrides:
- action in class Component
All Packages Class Hierarchy This Package Previous Next Index