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.

Constructor Index

 o MonthCal()
Create a new MonthCal containing the current month.
 o MonthCal(int, int)
Create a monthly calendar for year/month.

Method Index

 o getMonth()
Return the month of the calendar.
 o getNotes(int)
Get the notes for the day.
 o getYear()
Return the year of this calendar.
 o handleEvent(Event)
An action event is generated when the notes in a day changes.
 o setMonth(int)
Set the month of the calendar.
 o setNotes(int, String)
Attach the notes to the specified day.
 o setYear(int)
Set the year of the calendar.
 o toString()
Converts to a string representation.

Constructors

 o MonthCal
  public MonthCal()
Create a new MonthCal containing the current month.
 o 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.

Methods

 o setYear
  public void setYear(int year)
Set the year of the calendar. This causes a repaint.
Parameters:
year - calendar year, year number minus 1900.
 o getYear
  public int getYear()
Return the year of this calendar.
Returns:
calendar year.
 o setMonth
  public void setMonth(int month)
Set the month of the calendar. This causes a repaint.
Parameters:
month - calendar month, starts from 0.
 o getMonth
  public int getMonth()
Return the month of the calendar.
Returns:
calendar month, starts from 0.
 o toString
  public String toString()
Converts to a string representation.
Returns:
string representation.
Overrides:
toString in class Component
 o 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
 o 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.
 o 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