CS U370 Assignment #8. Section: Clinger Assigned: Tuesday, 28 November 2006 Due: Wednesday, 6 December 2006 This assignment is very slightly modified from a similar assignment designed by Professor Hafner. Used by permission. **************************************************************** This assignment may be done in teams of 2 students, or it may be done individually. Both members of a team will receive the same grade on the assignment. A slightly higher standard will be applied to work submitted by teams. Collaboration between teams is forbidden on this assignment. You are responsible for keeping your code hidden from all other students except your team partner. Part of your grade will be determined by how well you follow the instructions for submitting your code, et cetera; if you don't know by now, why tell you? Turn in your work on this assignment before 10:00 pm on the due date by sending an electronic mail message to will@ccs.neu.edu with subject CSU370 assignment 8 and a body that consists of nothing but your TimeCounter.java file. Files should begin with a block comment that lists 1. Your name, as you want the instructor to write it. 2. Your email address. 3. Any remarks that you wish to make to the instructor. Late assignments may be discounted, and very late assignments may be discarded. ---------------------------------------------------------------------- In this assignment, you will be taking the role of the client rather than the implementor of classes providing a service. You will make use of a complex set of inter-related classes, one of the most complex in existence: the Java GUI framework including java.awt (Abstract Windowing Toolkit) and javax.swing. You will make extensive use of interfaces. You are to create a file containing a public class with a main() method (and any additional helper classes) that implements a GUI-based visual count down timer (with behavior explained below). The name of the public class must be TimeCounter. It must be in the default package. This assignment will be graded severely. Programs that do not compile will receive an automatic grade of 0. Some points will be allocated to the aesthetics (look and feel) of your program from the user perspective. Optional elements, if implemented correctly, will result in extra credit. ------------------------------------------------------------------- Signature: since this is an interactive client program, there is no signature associated with it. Behavior: 1. Required User controls. 1.1. The user sets the time for the count-down to a value between 1 second and 60 minutes, 00 seconds. 1.2. The user starts the timer. 1.3. The user can stop the timer before the count-down ends. 2. Required Program behavior 2.1. The program displays the count-down time. 2.2. When the user starts the timer, the remaining time is displayed. This display changes once per second, moving downward toward 0. 2.3. When the count-down is complete (i.e., the display goes to 0 remaining time), the count-down stops and a graphical image with animation is displayed. (The animation should last a few seconds and then stop.) This can be within the same window or a different window, but if it is in a different window there must be a button or other obvious control to dismiss that window (other than the built-in window-closing button which most windowing systems provide in the title bar). 2.4. Once the animation stops, the timer is ready for the user to set a new time. 2.5. If the user sets the time incorrectly, an informative error message is presented. 3. Required Java graphics elements 3.1. Setting the window size 3.2. Buttons, labels and text fields 3.3. Use of Java Timer objects 3.4. Use of a LayoutManager 4. Optional 4.1 Implement a pause/resume function that can stop the timer and then resume the count-down. 4.2. Make the timer work as either a count-down timer or a stopwatch (which starts at 0 and counts upward), at the user's option. If the pause/resume function is implemented for the count-down timer, it should also work for the stopwatch. 4.3. Use a drop-down menu to control the behavior of the TimeCounter in some way. If 4.2 is implemented, it can be used to select count-down vs. stopwatch behavior. Or, it can be used to control something about the graphical display when the timer goes to 0. Or, it can be used to control some other visual or behavioral properties of the TimeCounter.