Updated MVC GUI Application
You need to modify the demo application so that it
satisfies the following new requirements:
- There are 3 buttons: Reset, Append, and Undo;
- Reset clears both input and output text areas;
- Append appends the contents of the input text
area to the end of the text in the output text area, and
clears the input text area;
- Undo reverts the output text area to the state
before the last append and replaces the input text area with
the text removed from the output;
- The application supports unlimited undos, i.e.,
all appends can be undone.
Follow these steps:
- Download the AppendUndoGUI.zip
file and import a new project from it.
- Explore the new project and all its components. You
will find the main class AppendUndoGUI.java and the
interfaces updated to support the new functionality of the
application. You can open the doc/index.html file in
a browser to review the documentation for the components
provided.
- Your task is to provide the three classes: AppendUndoModel1,
AppendUndoView1, and AppendUndoController1
so that they implement the corresponding interfaces. The
easiest way to get started is to copy the DemoModel1.java,
DemoView1.java, and DemoController1.java
files from the DemoGUI3 project into the src
directory of the AppendUndoGUI project, rename them
appropriately, and then edit them until all compiler errors
are gone and their behavior matches the corresponding
interfaces.
Note 1: do not modify the given interfaces in any way.
Note 2: if you cannot get everything
compiling and/or working it is OK. You will get a chance to
complete this task in lab with help from the instructors.
However, you should try to get as far as you can on your own.
- An executable demo version of the modified application
is available. To run the demo, download the demo
archive, append-undo-gui.zip, to your computer.
Click on this download
link and save the file somewhere on your hard drive where you can
easily find it. Make sure that you do not expand this archive.
If your browser automatically expands downloaded zip archives, that's
OK too. Just pay attention to the special instructions in the
following few steps. You may want to make a note of where you saved
it.
Import your new project in Eclipse by following these steps:
- From the File menu select Import....
- In the new window, expand General and select Existing
Projects into Workspace. Click Next.
- Click on the radio button next to Select archive file
and then click the Browse... button. (If the archive was
expanded when you downloaded the file to your own computer, click on
Select root directory... instead.)
- In the file selection window, find the append-undo-gui.zip
file and select it. (If your browser expanded the archive, find the append-undo-gui
directory instead.) Click OK.
- Click Finish.
To run the program, find the RunAppendUndo.java file in the src
folder in the project and run it as usual as a Java Application.
For your homework, turn in printouts of the three files AppendUndoModel1.java,
AppendUndoView1.java, and AppendUndoController1.java.