com.jp.comp.calendar
Class CalendarControllerAdapter

java.lang.Object
  extended bycom.jp.comp.calendar.CalendarControllerAdapter
All Implemented Interfaces:
CalendarController
Direct Known Subclasses:
MonthCalendarController, MultipleMonthCalendarController

public abstract class CalendarControllerAdapter
extends java.lang.Object
implements CalendarController

CalendarController is a base abstract class implementing CalendarController's method selectionChanged and adding a fwe new methods to implement some basic logic for navigation

See Also:
CalendarInterface, CalendarPanel, MonthCalendarPanel, MultipleMonthCalendarPanel, DateField

Field Summary
protected  java.util.Calendar fCalendar
          The calendar to to date calculations
protected  int fColumn
          The new columns
protected  int fDay
          The new day
protected  int fMonthType
          The new month type
protected  int fRow
          The new row
 
Fields inherited from interface com.jp.comp.calendar.CalendarController
NAVIGATION_MONTH, NAVIGATION_WEEK, NAVIGATION_YEAR, SELECTION_COLUMN_CHANGED, SELECTION_DOWN_ARROW_PRESSED, SELECTION_LEFT_ARROW_PRESSED, SELECTION_RIGHT_ARROW_PRESSED, SELECTION_ROW_CHANGED, SELECTION_ROW_COLUMN_CHANGED, SELECTION_SHIFT_TAB_PRESSED, SELECTION_TAB_PRESSED, SELECTION_UP_ARROW_PRESSED
 
Constructor Summary
CalendarControllerAdapter()
           
 
Method Summary
protected  void currentMonthSelection(CalendarPanel aCalendarPanel, int aSelection)
          Does selection for current month.
protected  void determineSelection(CalendarPanel aCalendarPanel, int aRow, int aColumn, int aSelection)
          Determines selection using aRow, aColumn and aSelection and determines new values for fRow, fColumn, fDay and fMonthType
protected abstract  void nextMonthSelection(CalendarPanel aCalendarPanel, int aSelection)
          Does selection for previous month
protected abstract  void previousMonthSelection(CalendarPanel aCalendarPanel, int aSelection)
          Does selection for previous month
 void selectionChanged(CalendarPanel aCalendarPanel, int aRow, int aColumn, int aSelection)
          Invoked by the CalendarPanel when selection is changed by mouse or keyboard to perform navigation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jp.comp.calendar.CalendarController
next, previous
 

Field Detail

fCalendar

protected java.util.Calendar fCalendar
The calendar to to date calculations


fDay

protected int fDay
The new day


fMonthType

protected int fMonthType
The new month type


fRow

protected int fRow
The new row


fColumn

protected int fColumn
The new columns

Constructor Detail

CalendarControllerAdapter

public CalendarControllerAdapter()
Method Detail

selectionChanged

public void selectionChanged(CalendarPanel aCalendarPanel,
                             int aRow,
                             int aColumn,
                             int aSelection)
Invoked by the CalendarPanel when selection is changed by mouse or keyboard to perform navigation. This method invokes evaluateSelection method to evaluate current selection and then invokes a proper method for obtained fMonthType

Specified by:
selectionChanged in interface CalendarController
Parameters:
aCalendarPanel - the instance of the CalendarPanel
aRow - current or selected row (depending on the type of selection)
aColumn - current or selected column (depending on the type of selection)
aSelection - selection key
See Also:
#evaluateSelection, #currentMonth, #previousMonth, #nextMonth

determineSelection

protected void determineSelection(CalendarPanel aCalendarPanel,
                                  int aRow,
                                  int aColumn,
                                  int aSelection)
Determines selection using aRow, aColumn and aSelection and determines new values for fRow, fColumn, fDay and fMonthType

Parameters:
aCalendarPanel - the instance of the CalendarPanel
aRow - current or selected row (depending on the type of selection)
aColumn - current or selected column (depending on the type of selection)
aSelection - selection key

currentMonthSelection

protected void currentMonthSelection(CalendarPanel aCalendarPanel,
                                     int aSelection)
Does selection for current month. It has default implementation and usually doesn't require reimplementation. It sets a new fDay to aCalendarPanel by the method setDayOfMonth

Parameters:
aCalendarPanel - the instance of the CalendarPanel
aSelection - selection key

previousMonthSelection

protected abstract void previousMonthSelection(CalendarPanel aCalendarPanel,
                                               int aSelection)
Does selection for previous month

Parameters:
aCalendarPanel - the instance of the CalendarPanel
aSelection - selection key

nextMonthSelection

protected abstract void nextMonthSelection(CalendarPanel aCalendarPanel,
                                           int aSelection)
Does selection for previous month

Parameters:
aCalendarPanel - the instance of the CalendarPanel
aSelection - selection key