View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

M2 Individual GUI Coding Summer 2007

Now that we have a backend model, we will put a front end graphical user interface onto the code. Your primary tool for this will be the UI painter tool in visualworks.

Task 1:
First we need to modify our backend model slightly. Create a class User which knows its id and password. The class should have the following methods:
id returns the username (id)
validate: aPassword returns true if the user's password matches aPassword, false otherwise.

Second, we need to modify our Project class from M1 so that it maintains a list of users. It should allow us to lookup a user by id (name) and to add new users. New methods to add include:
addUser: aUser Adds a new user to the project.
findUser: anId returns the user with id=anId.
removeDefect: aDefect removes the defect aDefect from the project
HINT: the Dictionary class can help with this.

Task 2:
Next we want to create the main UI window. For M2, our main UI will be pretty simple. Create a window with title Techzilla that has 5 buttons : Login, Add defect, Remove Defect, Show report, and Exit. When the window first comes up, only Login and Exit buttons should work. (For 5 points extra credit you can disable the 3 middle buttons until login is successful, then after login disable the Login button and enable the middle 3 buttons). Additionally, when the application is initialized, create a Project, and a user id:'guest' and password: 'pass' and add that user to the project. The project will be our domain model for M2.
The actions to take for each button are:
Login Prompt the user for a user id and password. After getting the input validate the user to be sure login is correct.
Add Defect Prompt the user for information necessary to create a new defect and add it to the projects defect list.
Remove Defect Display a list of all current defects. After selection of a defect by the user, that defect is removed from the project.
Report Display a list of available reports. After selection of a report type by the user, print the report to the transcript.
Exit Exit the application.

Grading Criteria

User Class ............................ 10
Project Class enhancements............. 10
Main Window displays with 5 buttons ... 10
Login button validates user ........... 10
Add Defect button adds new defect ..... 10
Remove Defect removes defect .......... 10
Report button generates correct report. 10
Exit button closes application ........ 10
Comments .............................. 10
Smalltalk style ....................... 10

Extra Credit:
Buttons disable/enable with login ..... 05
Custom dialogs used instead of builtins 10
Main Menu Bar.......................... 05


Link to this Page