Homework 4: Extending the Graphical User Interface

To Deliver:         Release 4.0

To Download: 

Due date for submission:    October 12, at noon (12.00 PM), before fall break

Drop out date:                     October 17, at 5 AM (early morning), after fall break


Motivation

One step in learning a new programming language is always to figure out how to interact with a user. This often means programming a graphical user interface (GUI). In the near future this will include natural language processing, and a bit further on this will include a brain-machine interface. For this homework, we will restrict ourselves to some modest extensions of the Maze GUI. In particular we want to support some of the more recent features that are currently not accessible for a user. 


A GUI is an example of a reactive program where a program reacts to an ongoing user interaction. This is different to the common point of view where a program is started with a given set of parameter and then follows through a sequence of operations till it delivers the results and terminates. With a GUI, a user may trigger and influence the program behavior at any point in time. One way to think of it is as a finite automaton or an I/O automaton: the program reacts to user input and its reactions may depend on the usage history as it is stored in the internal state information of the automaton. In more practical terms, GUI programming requires you to 


When it comes to GUI programming, there are multiple toolkits to choose from, see e.g. Feigenbaum's comparison between SWT, Swing and AWT (as of Feb 2006).

We will focus on Swing and AWT.  The Java Swing and AWT classes provide support for GUI programming in Java, you may want to consult a wiki page and the Java Swing API documentation  with its tutorial.


As far as testing is concerned, GUI development and testing requires further efforts which I feel exceeds what we can cover in this class, see e.g. announcements for GUI testing tools  and Tools in general at Junit.org, which include JFCUnit, Jemmy, Abbot, Marathon, and UISpec4J. So for this part of the project, we will restrict ourselves to manual tests and you are NOT asked to write Junit tests first. 


Requirements

  1. MazeApplication.main() is and shall remain the main method to start the maze application. Besides that you can modify the Maze.java class and add further classes if you like. 
  2. The Maze application supports 4 screens: the welcome screen, the generating screen, the playing screen, and the finish screen. The four screens may change in appearance and may provide more functionality, but having those four screens seems reasonable and should stay. They are currently implemented with 3 viewer classes: MazeView.java, MapDrawer.java, FirstPersonDrawer.java.
  3. We will need a separate area close to the current screen to offer buttons and other graphical means for user input.
  4. On the welcome/starting screen: The selection of the skill level currently is the only input necessary, it is combined with an immediate switch to the generating screen. This will need to change, if a user can choose/configure the settings of several, different parameters. Extend the GUI to support the following features:
  5. On the generating screen: 
  6. On the playing screen:
  7. On the finish screen: 


There is a visual guide to Swing Components. Note that there is also the AWT library. 


To do list:




Grading: 


You will receive points