CSC 365- Programming project 1 (Due 9/23/2005)
For this project you are expected to develop a GUI interface for a
RASHTY/English translator similar to what you build in project 0:
- RASHTY-English dictionary
- English-RASHTY dictionary
- Add/Update Word
- Remove Word (not shown in the image)
- Translate
- Commit Changes/Exit
You will need to use the Map Interface
and its implementation
TreeMap to store English/RASHTY words with the RASHTY word as the key and the English word as the value.
The data file from project #0 should be used here to load the data into your Map object.
Swing Employee Application shows you
how to load word/meanings from a data file into a Map object as well as give you the framework for a GUI interface.
The following image should give you a reasonable layout for your frame; note that the Remove option is not shown but needs to be implemented:
When R/E is chosen:
- The RASHTY, English, and the Message fields are disabled.
- list RASHTY/English words in RASHTY word order.
When E/R is chosen:
- The RASHTY, English, and the Message fields disabled.
- list English/RASHTY words in English word order.
When Add option is chosen:
- The English and RASHTY word fields need to be enabled.
- The Message field should be disabled.
- A message placed in the display area at the bottom of the screen directing the user to enter
both words. Once the < Enter > is hit in the English field, both words are validated
as they were in project#0.
- If RASHTY/English pair are both valid, they are put into the Map object.
Maps are designed in such a way that when a RASHTY word already exists, the English word being added
replaces the "old" value, the message displayed for the user should make that clear.
- A message indicating success or Failure of this operation
is displayed in the display area at the bottom of the screen.
When Remove is chosen (not shown as an option in the image above):
- The RASHTY field must be enabled.
- The English and the Message fields disabled.
- An appropriate message should be displayed for the user.
- Once the < Enter > is hit in the RASHTY field, they RASHTY/English
entry needs to be deleted.
- A message indicating success or Failure of this operation
is displayed in the display area at the bottom of the screen.
When Translate is chosen:
- The Message field is enabled.
- The English and RASHTY word fields are disabled.
- A message placed in the display area at the bottom of the screen
directing the user to enter a message in the message field followed by an
< Enter >.
- This message is to be processed the same way as you processed the RASHTY
message in project #0, translating the words that are found in the
dictionary and leaving the other characters intact.
- The result of the
the translation is then displayed in the display area at the bottom of the screen.
When Exit is chosen:
- The dictionary file is opened for output.
- all entries from the Map object are written to the file in
the appropriate format.
- The application is then exited normally.