This page last changed on Sep 20, 2011 by cemeyer2.
Assignment 1.3 – Creating a GUI for our path finding library
This final part of the assignment will be due on September 22nd, 2011 at 10:00 AM CST in SVN. This assignment will be an extension of the maze solver library. Specifically, it will create a GUI interface for your libraries. Please commit your assignment to a directory called Assignment1.3 in SVN. Please match this spelling exactly.
For this assignment we will be building a Graphical User Interface (GUI) for the maze solving libraries we have developed. As a method of creating this GUI, we’ll be turning to the model-view-controller (MVC) software architecture. In an MVC architecture there are three components that comprise all the pieces of a GUI. The Model is used to hold data related to an application. In the context of this assignment, this might be the maze representation(s), state of the solution, state of the GUI, etc. The View component contains what the user will see. A view would have all buttons, labels, frames, pictures, and other graphical elements. The Controller handles communication between the user and the application. It will contain the functions to handle button clicks, for example. The following link is an excellent description of the MVC design paradigm (this is the one shown in lecture): http://www.cs.rice.edu/~cork/newBook/node89.html.
To aid you in understanding how to use MVC, take a look at a set of slides that a former TA put together:
You need flash player installed to preview ppt and pdf files
UI Patterns you can choose from for this assignment:
Extras On Demand
Please include a short README.txt plain text file with your submission. In it please describe your architecture, how you employed the MVC architectural pattern, and which UI pattern(s) you used and how you used them.
For this assignment, the challenge will be to make your editing features more interactive. Namely, you need to make it such that your UI has some tools such as in MS Paint, such as a square tool, a circle tool, etc. Your UI should allow you to use these tools to edit the map by making areas of the map be not walkable.
As always, you will be graded on participation and implementing the guidelines for modular, readable code. Additionally, you will be graded to ensure that you meet the requirements listed above.
The mega-maze requirement
When you compose many images into one to solve together, you may find your hash function does not work as well due to the large dimensions. You might need to come up with something different. The animation below shows an example of what the algorithm looks like as it solves a “mega-maze”. The yellow is the closed list, green is the current open list, and the red line is the found path thus far:
If you decide to use the UI builder in Netbeans, IntelliJ, or Eclipse for this assignment, be very careful. Although the UI builder quickly generates Java GUIs, it produces very ugly code that will not meet the requirements for this assignment without modification. Most noticeably, it tightly couples the view with the controller, so significant refactoring of the auto-generated code will be required. In the staff’s opinion, it is more work to generate a UI automatically and refactor it properly than to build one from scratch.
Hand written code
Netbeans autogenerated code
How do I test a GUI?
We expect you to write junit unit tests for all of your controller code. The controller functions should be able to be invoked without the view present if needed. For testing the view, there are tools out there that will let you write automated UI functional tests, such as SWTBot and Rational Functional Tester, but we do not expect you to use them for this assignment. Rather, we ask that you create a manual test plan. A manual test plan is a document that contains the steps that a user would need to manually do with your application along with screenshots of it at each step so that the user can verify that the test is progressing as expected. We expect you to write an entry in your manual test plan for each of the main features of your application.
GUI programming can be a potentially daunting experience. Below are some external resources to help get you going.