Class tea.set.MonthCal
All Packages Class Hierarchy This Package Previous Next Index
Class tea.set.MonthCal
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----tea.set.Grid
|
+----tea.set.MonthCal
- public class MonthCal
- extends Grid
MonthCal widget provides an interface to manipulate one month calendar.
The interface of MonthCal resembles a monthly organizor. The days
are layed out in a grid. Each day can have a notes attached to it.
Users can enter a notes to a day by double click inside the day
cell. Since MonthCal is inherited from Grid, all Grid method can
be used to manipulate the behavior and apparence MonthCal.
-
MonthCal()
- Create a new MonthCal containing the current month.
-
MonthCal(int, int)
- Create a monthly calendar for year/month.
-
getMonth()
- Return the month of the calendar.
-
getNotes(int)
- Get the notes for the day.
-
getYear()
- Return the year of this calendar.
-
handleEvent(Event)
- An action event is generated when the notes in a day changes.
-
setMonth(int)
- Set the month of the calendar.
-
setNotes(int, String)
- Attach the notes to the specified day.
-
setYear(int)
- Set the year of the calendar.
-
toString()
- Converts to a string representation.
MonthCal
public MonthCal()
- Create a new MonthCal containing the current month.
MonthCal
public MonthCal(int year,
int month)
- Create a monthly calendar for year/month.
Year starts from 1900, so pass 96 for 1996.
Month starts from 0 to 11, corresponding to Jan to Dec respectively.
- Parameters:
- year - calendar year, year number minus 1900.
- month - calendar month, starts from 0.
setYear
public void setYear(int year)
- Set the year of the calendar. This causes a repaint.
- Parameters:
- year - calendar year, year number minus 1900.
getYear
public int getYear()
- Return the year of this calendar.
- Returns:
- calendar year.
setMonth
public void setMonth(int month)
- Set the month of the calendar. This causes a repaint.
- Parameters:
- month - calendar month, starts from 0.
getMonth
public int getMonth()
- Return the month of the calendar.
- Returns:
- calendar month, starts from 0.
toString
public String toString()
- Converts to a string representation.
- Returns:
- string representation.
- Overrides:
- toString in class Component
handleEvent
public boolean handleEvent(Event e)
- An action event is generated when the notes in a day changes.
The target is set to MonthCal itself, and arg is set to the
day number (Integer).
- Parameters:
- e - event object.
- Overrides:
- handleEvent in class Grid
getNotes
public String getNotes(int day)
- Get the notes for the day. If no notes is attached to the day,
null is returned instead. Day number starts at 1.
- Parameters:
- day - day number.
- Returns:
- text notes for the day.
setNotes
public void setNotes(int day,
String notes)
- Attach the notes to the specified day. Day number starts at 1.
- Parameters:
- day - day number.
- notes - text notes for the day.
All Packages Class Hierarchy This Package Previous Next Index