clock
Class View

java.lang.Object
  extended by clock.View
All Implemented Interfaces:
java.util.Observer

@ClassPreamble(author="Ian Barnes",
               date="01.04.2007",
               currentRevision=2,
               lastModified="29.03.2007",
               lastModifiedBy="abx")
@ToDo(value={"Add menu","Implement Listeners","Turn into AlarmClock"})
public class View
extends java.lang.Object
implements java.util.Observer

The View class represents the data of the Model class

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

Field Summary
(package private)  AnalogClockPanel panel
           
 
Constructor Summary
View(Model model)
          constructor for the View object: creates an instance of AnalogClockPanel which uses the provided model
 
Method Summary
 void update(java.util.Observable o, java.lang.Object arg)
          implements Observer interface by repainting the panel in accordance with the latest data from the model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

panel

AnalogClockPanel panel
Constructor Detail

View

public View(Model model)
constructor for the View object: creates an instance of AnalogClockPanel which uses the provided model

Parameters:
model - Model object with time data
See Also:
Model, AnalogClockPanel
Method Detail

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
implements Observer interface by repainting the panel in accordance with the latest data from the model

Specified by:
update in interface java.util.Observer
Parameters:
o - the observable object (model)
arg - the additional data passed to notifyObservers method (none, here)