clock
Class Controller

java.lang.Object
  extended by clock.Controller

public class Controller
extends java.lang.Object

The Controller class of the Clock application contains event handler (which implements ActionListener as an anonymous inner class) for dealing with Time. Some (code analysis tools) might say the Controller isn't necessary because other objects do not use it. This is wrong — Controller generates events which affect model Model.update()

Author:
Ian Barnes (2005 original version), abx (2007 adopted for a GUI assignment and javadoc tags added)
See Also:
Model, View

Field Summary
(package private)  java.awt.event.ActionListener listener
          event handler which calls to repaint the clock panel
(package private)  Model model
          model maintains value of hours, minutes and seconds and call the update
(package private)  javax.swing.Timer timer
          timer to maintain the clock count
(package private)  View view
          view defines the panel on which every thing is drawn
 
Constructor Summary
Controller(Model m, View v)
          creates controller linked to view and model
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listener

java.awt.event.ActionListener listener
event handler which calls to repaint the clock panel


timer

javax.swing.Timer timer
timer to maintain the clock count


model

Model model
model maintains value of hours, minutes and seconds and call the update


view

View view
view defines the panel on which every thing is drawn

Constructor Detail

Controller

public Controller(Model m,
                  View v)
creates controller linked to view and model