caltool.schedule_ui
Class OKScheduleEventButtonListener

java.lang.Object
  extended by caltool.schedule_ui.OKScheduleEventButtonListener
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class OKScheduleEventButtonListener
extends java.lang.Object
implements java.awt.event.ActionListener

Class OKScheduleEventButtonListener defines the action listener that is attached to the OK button in the schedule appointment dialog. When the class is constructed, it is passed references to the classes that need to be accessed in the actionPerformed method. In this case, the required classes are the Schedule model class and the ScheduleEventDialog view class.

Access to the model is for calling the scheduleEvent method. Access to the view is for gathering the data values that are sent to scheduleEvent.


Field Summary
protected  ScheduleEventDialog dialog
          The parent view
protected  Schedule schedule
          The companion model
 
Constructor Summary
OKScheduleEventButtonListener(Schedule schedule, ScheduleEventDialog dialog)
          Construct this with the given Schedule model and parent dialog view.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Respond to a press of the OK button by calling ScheduleEvent with a new Event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

schedule

protected Schedule schedule
The companion model


dialog

protected ScheduleEventDialog dialog
The parent view

Constructor Detail

OKScheduleEventButtonListener

public OKScheduleEventButtonListener(Schedule schedule,
                                     ScheduleEventDialog dialog)
Construct this with the given Schedule model and parent dialog view. Access to the model is for calling its scheduleEvent method. Access to the parent view is for gathering data to be sent to scheduleEvent.

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Respond to a press of the OK button by calling ScheduleEvent with a new Event. The Event data are gathered from the JTextFields and JComboBox in the parent dialog.

Specified by:
actionPerformed in interface java.awt.event.ActionListener