CISC 181 Introduction to Computer Science, Fall, 1998
Programming Project - A Clock Applet.
-
First things first. In today's lab, at least do this:
Finish and submit your Clock prototype
with working hour, minute, and second hands.
-
Then begin work on the clock applet project. There are Basic and
Delux features to this assignment. Next Monday, Oct 12 in lab, submit
java code for a clock meeting the Basic specification. In that lab we
will work on web page design.
- On Monday, Oct 19 in lab, submit a
final Delux clock with associated web page.
Clock Applet Basic Specifications
Write a Clock applet whose paint method draws a clock with animated
hands. The clock should have three properly working hands, showing
hour, minute, second. The hands should advance at the proper interval.
For testing purposes the applet should exploit an integer parameter
"SPEED" in the applet tag. The clock should then run at a rate that
moves the second hand SPEED seconds per actual second.
The Basic specification also calls for a multicolored design for the
cabinet and clock face and clock hands. This is to exercise the use
of drawPolygon and/or fillPolygon, and the use of custom colors.
To meet this specification you must
-
Use at least 10 colors in your design, of which at least 5 are
custom specified from R,G,B values.
- Create clock hands which are more than just line segments.
Each hand can be a polygon or a combination of polygons and ovals,
for example.
- Design a colorful clock face and "cabinet". In otherwords,
make the background for your animated hands be something colorful
and at least moderately complex geometrically.
Clock Applet Delux Specifications
Your final clock must include buttons with which the user can
set the clock. We will be discussing graphical user interface, GUI,
this week. Probable implementation. Puch hour button to advance hour
by one, (by one per second while button held down), similarly,
push minute button to set minute.
Also,
Your final clock, to be labeled Delux, must incorporate at least
one of the following features.
-
Scalability: Design your applet so that it can be scaled larger or
smaller depending on parameter settings.
-
Skew scalability: scaling factor can be different in x and y
coordinates, thus with certain parameter settings, the clock could have
a non-circle oval face, for example. Then, what should the hands do?
- Hour (and minute) marks: Fancy, well placed labels for the hours.
- Alarm feature (visual or audio).
- Stopwatch features: start, stop, lap, reset.
- Time zone: User can select a time zone, while that time zone is
selected, clock displays current time in that zone.
- Clock face shows phase of moon.
- Additional feature of your own imagination.
We plan to create a page off the course web page containing an
assemblage of your clocks, all running. Be prepared to provide
an applet tag for that, which sets your favorite values of any
parameters you may be using.