caltool.view
Class MonthlyAgenda

java.lang.Object
  extended by java.util.Observable
      extended by mvp.Model
          extended by caltool.view.MonthlyAgenda
All Implemented Interfaces:
java.io.Serializable

public class MonthlyAgenda
extends mvp.Model

A MonthlyAgenda contains a full month name, the day of the week for its first day, and the number of days. Scheduled item data are contained in a small daily view for each day of the month, organized in a fashion typical in paper calendars.

The primary access interface is through the getFirstDay and getNextDay iterators. These methods deliver each day of the month in turn, as a small day view object.

The current implementation is a stub consisting of a sample 30-day month that starts on Tuesday. The actual implementation will consult the CalendarDB to obtain real monthly data.

See Also:
Serialized Form

Field Summary
protected  int currentDate
          Iterator state variable containing the date number.
protected  int currentDay
          Iterator state variable containing the ordinal day position in a 6x7 grid.
protected  DayName firstDay
          First day of the month
protected  FullMonthName fullMonthName
          Full name, consisting of month name and year.
protected  int numberOfDays
          Number of days in the month
 
Fields inherited from class mvp.Model
view
 
Constructor Summary
MonthlyAgenda(CalendarDB calDB)
          Construct this with the given CalendarDB.
 
Method Summary
 SmallDayView getFirstDay()
          Return the first day of the month as a SmallDayView, q.v.
 java.lang.String getFullMonthName()
          Return the full month name as a single string.
 SmallDayView getNextDay()
          Return the second and subsequent days of the month.
 int getNumberOfWeeks()
          Return the number of weeks in the month.
 void selectDate(int date)
          Build a complete Date out of the given date number and call the CalendarDB to select that date.
 void update(java.util.Observable o, java.lang.Object arg)
          Update this' data based on the current selection in the current calendar.
 
Methods inherited from class mvp.Model
dump, exit, getView, setView
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fullMonthName

protected FullMonthName fullMonthName
Full name, consisting of month name and year.


firstDay

protected DayName firstDay
First day of the month


numberOfDays

protected int numberOfDays
Number of days in the month


currentDate

protected int currentDate
Iterator state variable containing the date number.


currentDay

protected int currentDay
Iterator state variable containing the ordinal day position in a 6x7 grid.

Constructor Detail

MonthlyAgenda

public MonthlyAgenda(CalendarDB calDB)
Construct this with the given CalendarDB. Call update to get the data values for the initially current month.

Method Detail

getFullMonthName

public java.lang.String getFullMonthName()
Return the full month name as a single string.


getFirstDay

public SmallDayView getFirstDay()
Return the first day of the month as a SmallDayView, q.v.


getNextDay

public SmallDayView getNextDay()
Return the second and subsequent days of the month. Return null when all days have been produced.


getNumberOfWeeks

public int getNumberOfWeeks()
Return the number of weeks in the month.


selectDate

public void selectDate(int date)
Build a complete Date out of the given date number and call the CalendarDB to select that date. This is fixed for initial testing.


update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Update this' data based on the current selection in the current calendar. For initial testing purposes, the fixed month of September 1998 is created, which starts on Tuesday and has 30 days. In the refined implementation, the calendar db will be consulted to obtain the actual information for the currently selected month.