Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CMPT 270

Fall 2022

Developing Object Oriented Systems

Assignment 6

Graphical User Interfaces

Overview

• The objective of this assignment will be to add a graphical user interface (GUI) front end to the work done in Assignment 5. The implementation of the GUI will be partially completed for you to start, so that the assignment is not too long.

•  It is highly recommended that you use the classes provided in the Assignment 6 folder as your starter code.

 All the command classes have been refactored in the provided code.

 The Animal class has a new method called getStaff() which allows you to get all the assigned staff members of a certain animal.

  Likewise the StaffMember class has a new method called getAnimals() which allows you to get all of the assigned animals of a staff member.

• You should not change the entity and container packages in this assignment.

• You should not change the classes in the commands package, although if needed, new commands can be added.

•  In A5, you worked on the PetStoreSystem class and the IOInterface class, etc.  In A6, these will not be used.

• A new class called GuiPetStoreSystem has been added to the startup package to start up the event- driven application.

• We have provided some GUI classes for you to work with and start from, in the package gui.

• The new classes that you write are to be placed in the package gui.

When the application first starts (Running GuiPetStoreSystem), a window will appear prompting the user to input information that will be used to create a new pet store. It has field for store name, the first kennel label and the last kennel label. A submit button at the bottom submits the information to the system.

After submission of the information, another window appears that deals with animal operations (See the

animal operations window section below for more details). This window has four options: adding a new animal,

a text field for entering an animalID, a button to list all animals currently in the system, a text field with a button

to search and show all animals of a specific type, and a button to close the window. For the text field where you can enter an animalID, if a vald animalID is input and the enter key is pressed a new window appears with

information on the animal, and allows some operations on the animal.

The animal information window lists all information about the animal, including its assigned kennel as well as all currently assigned staff members. This window also has a button for assigning the animal to a kennel that opens the store’s kennel assignment window (Described below). Also in the animal information window is a text filed where an employeeID can be entered, and after enter is pressed the staff member with that employeeID is assigned to the animal, and the animal is assigned to the staff member. At the bottom of this window is an exit button that closes the window.

The kennel assignment window lists all kennels in the store.  If a kennel is occupied the animalID of the animal in the kennel is shown under“Occupant”, and a button to remove the animal is shown under“Insert with ID / remove button”. If the kennel is not occupied, no animalID is shown and a text field is displayed, where an animalID can be input, and after enter is pressed the animal is assigned to the specified kennel. At the bottom of this window is an exit button that closes the window.

Question 1 (50 points):

Purpose:  Practising GUI design and Implementation.

Degree of Difficulty: Tricky                                                                                                                              In this question you will add additional windows and fucntionality to the partially implimented GUI, built upon the work done in assignment 5. A description of the currently implimented windows is given above. Be sure to go over the overview section above thoroughly, as it details how the system works, and which windows have already been implimented.

Task

Your task is to modify the system so that after the submission of the store information a new window appears. This should be a “main menu”window. You will design and implement this window. This window should have the following four components:

1. A button for animal operations. This button should open the animal operations window (this is the window that currently opens right after the store is created).

2. A button for staff member operations. This button when pressed should open a new window (Staff operations window). You will need to design and impliment this window. This window should meet the following specification:

• A button to add a new staff member. This option should create a new window (add staff window) where the data for a new staff member is entered, and a button is pressed to submit the data to the system to add the new staff member. You will also have to design and implement this add

staff window.

• A text field for the entry of a staff member’s employeeID. When a valid employeeID is input and the Enter key is pressed, a new window (a staff member information window) is opened that dis- plays the staff member’s information, including if they are a manager or not. The staff member’s infrmation window should contain the following components:

 A TextField and button to add an animal to the staff memebr’s list of assigned animals.

 A TextField and button to access a specific animal assigned to the staff member.  This op- tion should open the same animal’s window as accessing a specific animal from the animal operations window.

 A TextField and button to remove an animal from the current staff member’s list of assigned animals.

 A button to close the window.

• A button that uses JOptionsPane to list all the staff in the system. For simplicity, they can be listed in the JOptionsPane with default formatting obtained from the dictionary. HINT: This is mostly the

same as the button in animal operations to list all animals in the system.

• A button to close the window.

3. A button for opening the kennel assignment window. This is the kennel assignment window described above and accessed by pressing the‘assign‘”button in the animal information window. This window has already been implimented and given in the starter code for this assignment.

4. A button for closing the system. The system should also be able to be terminated by clicking the“X”in the right hand corner of the main menu window as well. However, selecting the“X”in another window should just close the window (the default action for that (built in) button).

What to Hand In

• A file titled A6 .jar of your complete system.

• A zip folder titled A6Q1 .zip that contains all the GUI classes you created

Be sure to include your name, NSID, student number and course number at the top of all documents.

Evaluation

10 pts  For the jar file (should successfully run and be stand alone)

40 pts  For each new window implimented (Main menu, Staff operations, Add staff, and Staff information windows)

Question 2 (20 points):

Purpose:  Practising External Documentation

Degree of Difficulty:  Easy

Once you have completed the questions above, create a file called A6_documentation .pdf that includes all the internal documentation for the refactored system. External documentation should include:

• A description of how to run your system. What class should be invoked, what method?

• The status of your assignment. What is working and what is not working? What is tested and what is not tested? If it is only partially working, the previous point should have described how to run that part or parts that work. For the part or parts not working, describe how close they are to working. For example, some of the alternatives for how close to working are (i) nothing done; (ii) designed but no code; (iii) designed and part of the code; (iv) designed and all the code but anticipate many faults; or

(v) designed and all the code but with a few faults; (vi) working perfectly and thoroughly tested.

•  Instead of a UML diagram, include the following diagrams (these can be hand drawn and scanned):

 A diagram showing how you laid out the main menu window. It should show how you used GUI components in order to place the widgets in the window in appropriate places.

 A diagram showing how you laid out the staff member operations window. It should show how you used GUI components in order to place the widgets in the window in appropriate places.

 A diagram showing how you laid out the window for adding a new staff member. It should show how you used GUI components in order to place the widgets in the window in appropriate places.

 A diagram showing how you laid out the staff member information window. It should show how you used GUI components in order to place the widgets in the window in appropriate places.

What to Hand In

• A file titled A6_documentation .pdf

Be sure to include your name, NSID, student number and course number at the top of all documents.

Evaluation

4 pts  For the system description and assignment status detailed above (2pts each). 16pts  For the four required window diagrams (4pts each).

Additional information

Window Design:  For the new windows you will create, the components can be arranged in any pleasing fashion. Don’t spend too much time making it fancy, but it must be usable. They will have to match the design diagrams you submit as part of your external documentation.

Animal Operations Window: This window has options to add a new animal to the system, access a specific animal, list all animals in the system, and close the window. If a specific animal is accessed, the window that appears has the animal’s information. An animal’s window allows certain operations on the animal. In particular, if the animal is not presently assigned to a kennel, an assign button is in the window that opens the kennel assignment window. In the kennel assignment window, the user can assign the animal to a kennel. Returning to the animal’s window, if the animal is already assigned to a kennel, then a remove button exists to remove the animal from the kennel. The animal’s information window lists all assigned staff of the animal (each of which can be removed), and has a textfield to add a staff member to the animal’s list.  However, in the version of the classes as given to you, there will be no way to add new staff to the system, so you cannot add a staff member to the list of assigned staff of the animal. Of course, you will be correcting this problem. It is suggested that you first get a basic version of the window working for the main menu, and have it appear after the residence creation window. In the main menu window, first get the button working for the animal operations window. Next, the button for the kennel assignment window can be done, and the button to exit the system. After these are working, then start working on the staff member operations window and the button of the main menu to show it. You can start with only the close button in the staff member operations window, and then add the others. Note that the staff operations window will be very similar to the animal operations window, and the classes for the latter are given to you. Then, you need to build the window to add a new staff member, and the window that appears when a specific staff member is accessed. It is suggested that initially you don’t worry about error situations.