Lab 11
The purpose is to enhance the JTimeLogger application.
Activity
- Download the source for the JTimeLogger:
JTimeLogger.zip
Unzip the archive.
- An ant script is provided. To compile the application,
open a terminal window, navigate to the root directory containing
the "build.xml" file and
type
ant
To run the application, type
ant run
- Explore the features to
understand its capabilities.
- Study the classes that comprise the application. Notice how
the GUI is separate from the underlying data model.
- Implement the following features as time allows, in the order
shown:
- Notice if you change the Font size to 8 (via Options ->
Font) the
column headers are no longer aligned with the fields in the list
box. It is relatively simple to change the way the components are
organized in the layout manager to correct this problem.
- Adjust the button positions so they are at (or near) the
top. The Interrupt button should be separate, positioned at the
bottom.
- Modify the program so that the names of the buttons are read
from a
properties file named "Timelogger.properties". The property
"tasknames" is a comma-delimited string with the labels of the
buttons. The first '&' character encountered in a label
indicated the subsequent character is the shortcut key.
Example:
tasknames =
"&Design,&Code,Co&mpile,&Test,&PSQ,&Review"
There can be at most ten labels. (Note that
"Interrupt" is always displayed and thus not in the properties file).
-
Modify the "Total Times" function to use these phases.
- Implement the Add Entry dialog (see details below).
- Enable double-clicking on a log entry to popup a dialog
allowing the user to modify the comment field. When this feature
is working, remove the add comment dialog that appears every time you
stop the timer.
- Add a Setup Dialog to the Options -> Setup menu
item. It uses a tabbed pane. Provide three tabs as shown, but you
only need to implement the "Task Names" tab.
Save the tasknames in the properties file.
Add Entry Detailed Requirements
The dialog is to appear like this picture:
Each data entry field displays a tooltip:
"Enter the date (MM/DD/YYYY)"
"Enter the Start time in military time (HHMM)"
"Enter the Stop time in military time (HHMM)"
"Select the task name"
Each button displays a tooltip:
"Add the entry to the time log"
"Delete the previous entry in the time log"
"Quit manual entry and return to main window"
Each button has a shortcut key.
The Date field is automatically filled in with the current date
when the dialog appears.
The Task combo box is populated with the names of the
phases/tasks. (Obtained from the properties file).
The Start and Stop fields accept a 4-digit number.
When the Add button is clicked, check that none of the data fields are
empty.
If a field is empty show a popup error message.
(For now you may assume that the any user-supplied data is valid.)
The Dialog stays visible to allow multiple entries until the user
clicks Quit.
Submission
Demonstrate your completed program to the instructor.
Create a zip file containing all the source code files. Name it
Lab11.zip.
Submit the zip file via handin
to the "Lab11" folder.