Overview
For this homework you will define inner classes that will control an
animation. . The animation consists of a pair of "Eyes" which look around in
a circular pattern. The video EyesDemo.avi
illustrates the functionality associated with the application.
Notice that there are no public/release/secret tests associated with this
project. You do not need to provide any student tests but you are encouraged
to develop them as you implement this programming assignment.
Objectives
This project is designed to help you develop your skills at defining
inner/nested classes.
Grading
- (95%) setListeners method
- (15%) start animation listener
- (15%) end animation listener
- (15%) slider animation listener
- (50%) timer object and listener
- (5%) style
Clarifications
Any clarifications or corrections associated with this project will be
available at: Clarifications
Code Distribution
The project's code distribution is available by checking out the project
named InnerClasses. The code distribution provides you with
the following:
- eyes package → Includes the classes Eyes.java and
EyesController.java.
- Project description
Specifications
For this homework you will implement a method called
setListeners (part of the EyesController class) and any
supporting classes that will allow us to control an animation. The animation
consists of a pair of "Eyes" which look around in a circular pattern. The
following video (EyesDemo.avi)
illustrates the functionality associated with the application. Complete
documentation for this project can be found at javadoc documentation
Keep in mind that the provided code already implements a listener for
mouse movements (the eyes will follow the mouse pointer). Your task is to
expand the functionality of the application as follows:
- Add a timer object and appropriate listener that will enable the
movement of eyes in a circular pattern.
- Add a listener to the start animation button that will start the
animation.
- Add a listener to the end animation button that will end the
animation.
- Add a listener to the slider object that will increase the speed at
which the eyes move.
From the Eyes class the only method you will need to use is the
setPointerPosition. This class may not be modified.
Requirements
- You may only add inner and anonymous classes to the provided code.
- One of your listener objects must be implemented using an anonymous
inner class.
- One of your listener objects must be implemented using an inner
class.
- You must attempt to submit your project immediately after checking out
the project (even if you have not implemented any methods). This will
allow you to verify that the submission process is working as expected.
- You should submit your project often. This will keep versions of your
project in the submit server that are easy to retrieve (you can also get
previous versions from your CVS repository). If your computer crashes or
you experience any other problem you will have a permanent backup in the
submit server.
- No student tests are required for this project but you are encourage to
develop them as you implement this programming assignment.
- Style
- Good variable names.
- You must avoid code duplication by calling appropriate methods
(rather than cutting and pasting code). You may define your own
private utility methods to perform often repeated tasks.
- Style as defined by the Eclipse Format Element option (Source
→ Format → Format Element) or as specified in Code
Conventions for the JavaTM Programming Language (focus on the
following sections: Indentation, Declarations, Statements, White
Space, and Naming Conventions).
- Although you should avoid source lines exceeding 80 characters, you
will not be penalize if they are present in your code.
Honor Section Requirements
No additional requirements.
Suggestions on How To Start the Project