Homework 2: Handling Mouse Input

Description

In this homework assignment, you are asked to add the handling of mouse input to the GUI you built from homework 1, making this component into a text-entry gesture recognizer.
 
This recognizer works the following way.  A gesture will always start from the resting zone (the circle at the center of the GUI) and should be recognized when  the mouse return to the resting zone.  

A gesture can be for a single letter (such as this gesture for the letter u).

U

Or  a gesture can be used to input any number of characters (such as this gesture for the word the).

the

To input the letter u, the user clicks and holds down the left mouse button in the resting zone and then enters zone 5 and then comes back to the resting zone from zone 3.  By cross-referencing the zones entered and exited with the spec file, you should be able to look up the letter gestured everytime the mouse returns to the resting zone.  Recall that the file specifying where to draw characters on this GUI defines for the letter u as o[5,3] : u.

The left mouse button does not have to be pressed inside the resting zone for it to be considered a valid gesture.  A valid gesture is defined as when the mouse exits the resting zone with the left  mouse button held down and returns to the resting zone with the left mouse button still down.  For example, in the following figure, the left mouse button is clicked and held down in zone 8, then the mouse is moved back into the resting zone, then zone 5, then zone 3, then returned to the resting zone and then finally the left mouse button is released.  This gesture is a perfect valid gesture for the letter u.

u2

As a result, after gesturing one letter, the user may continue to gesture for more without releasing the left mouse button.  This is how the word the was entered: by first gesturing for the letter t, and without releasing the left mouse button, the user continues to gesture for the letter h and then e.  

Recall that there are a set of special symbols in the interface.  These symbols actually represent special characters or have special commands/functions:
tidle


lower_case becomes upper_case



Again we are providing the file TestFrame.java which accepts a command line parameter pointing to the file specifying the text and symbol layout for the QuickWrite component.  This TestFrame.java file will construct a QuickWrite component and adds it to the frame and then displays the frame.  This means your QuickWrite component needs to implement a constructor that accepts a String argument which is the filename for this spec file.  Please use this TestFrame.java file; i.e., you code must work with TestFrame.java.

To demonstrate that this tool is work, your code should output the recognized gestured using System.println's to print when it has recognized some character (including backspace, space, and newline).

Deliverable

Please work on this homework assignment alone; please do not consult others.

This homework assignment should be done in JAVA, and needs to be compiled to run using SUN's JDK 1.4 or higher.  

Please zip up your source code and mail the zip file to the TA ( khai@cc.gatech.edu ) when you have completed the assignment (and remember to CC yourself on the email).  Please include in the email instructions on how to run your application.

The due date for this assignment is:  September 9, 2002, 12:00 PM EST.