Homework: Modify MVC GUI Application


This homework is necessary preparation for the lab. Make sure you type your answers and you bring the files to the lab. For this homework you should work in Eclipse.

  1. An MVC GUI Application

    1. For this assignment, instead of creating a new project, you will import a project already set-up for you. First you need to download the project, DemoGUI3.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 by following these steps:

      1. From the File menu select Import....
      2. In the new window, expand General and select Existing Projects into Workspace. Click Next.
      3. 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.)
      4. In the file selection window, find the DemoGUI3.zip file and select it. (If your browser expanded the archive, find the DemoGUI3 directory instead.) Click OK.
      5. Click Finish.
    2. Explore the new project and all its components. The DemoGUI3 program is a simple MVC application where each major component (model, view, and controller) is composed of an interface describing the behavior and a class implementing the behavior. You can also open the doc/index.html file in a browser to review the documentation of all the components.
    3. Run the application and make sure you understand completely what it does, how each component contributes to the observed behavior, and how the various components communicate and interact with each other.
    4. Once you are comfortable with the DemoGUI3 application, you can move on to the next step.
  2. Updated MVC GUI Application

    You need to modify the demo application so that it satisfies the following new requirements:

    Follow these steps:

    1. Download the AppendUndoGUI.zip file and import a new project from it.
    2. 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.
    3. 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.
    4. 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:

      1. From the File menu select Import....
      2. In the new window, expand General and select Existing Projects into Workspace. Click Next.
      3. 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.)
      4. 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.
      5. 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.