hw6

docx

School

Arizona State University, Tempe *

*We aren’t endorsed by this school

Course

341

Subject

Computer Science

Date

Apr 3, 2024

Type

docx

Pages

10

Uploaded by JusticeNarwhalPerson268

Report
Arizona State University - CSE205 -Assignment # 6 No late assignment will be accepted. Due Date: Wednesday February 24 by 11:59pm Important: This is an individual assignment. Please do not collaborate. Make sure that you write every line of your code. Using code written by someone else will be considered a violation of the academic integrity and will result in a report to the Dean's office. It must be submitted on-line (Course website). Go to "GradeScope" tab on Canvas -> CSE205 -> Assignment6, and upload your program file. Minimal Submitted Files You are required, but not limited, to turn in the following source file: Assignment6.java (Download this file and use it as your driver program for this assignment. This class is complete. You do not need to add code to this class) GeneratePane.java (Download this file. You need to add more code to complete it.) SelectPane.java (Download this file. You need to add more code to complete it.) Department.java (Download this file- this is complete) Requirements to get full credits in Documentation The assignment number, your name, StudentID, Lecture day/time, and a class description need to be included at the top of each file/class . A description of each method is also needed. Some additional comments inside of methods (especially for a "main" method) to explain code that are hard to follow should be written. New Skills to be Applied In addition to what has been covered in previous assignments, the use of the following items, discussed in class, will probably be needed: JavaFX, ArrayList Classes may be needed:   Button, TextField, TextArea, Label, CheckButton, and ActionHandler. You may use other classes. Program Description   Class Diagram:
Write a Java program that generates a GUI (Graphical User Interface). Your program should provide labels and textfields for the user to enter information regarding departments.   The GUI of your program should contain two tabs. The first tab is labeled "Add Department" and the second tab is labeled "Select Department".
(image066The size of the applet here is approximately 900 X 400). The section under the first tab should be divided into two parts: The left part contains labels, textfields, and a button for a user to add the department information. The right part shows "No Department" at the beginning (it is done using TextArea). A user can enter the information for a department, and push "Add a Department" button.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Then the department information should appear on the right hand side panel (note that department information is calling the toString() method of the Department class). A message "Department added" should also appear with  red color  at the top of the panel. textFields should be clear for the user to input the information for next department after user clicks the “Add a Department” button. Error handling: 1. If a user forgets to enter some field and pushes "Add a Department" button, the program shows a message " Please fill all fields" with  red color , and nothing should be added to the right-hand side panel.
2. If a user enters non-integer in the field for the number of faculty, and pushes "Add a Department" button, show a message "Please enter an integer for a number of faculty ." with  red color  and nothing should be added to the right-hand side panel.   3. If a user enters a department that already exists, with the same title and same name for the university and pushes the “Add a Department” button show a message “Department not added- already exist ” with red color in the label and the department will not added to the list of the departments.
After entering multiple departments, the GUI will have the following appearance. Under the "Select Department" tab, a user can select from those departments added to the list. The list of created departments should be made using a pane containing multiple check boxes. Above the pane containing check boxes, there should be a label to display “Select departments”. Below the pane with check boxes, there should be a label to display “The total number of faculties selected: 0”. However, this label should change to show a different number of faculties every time a check box is checked or unchecked.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
The list of departments under the Club Selection tab should be exactly same as the list under "Club Creation" tab. A user can check some check boxes. Every time one of the check boxes in the pane is checked or unchecked, then your program should compute the total number of members of the selected (checked) clubs and it needs to be updated in the label being displayed below. A user should be able to go back and forth between "Club Creation" tab and "Club Selection" tab, and these two panels need to have a same list of departments. Class description SelectPane Class: SelectPane class should contain at least the following instance variables: should ha
Attribute name Attribute type Description departList ArrayList A list of department objects ve a constructor: public SelectPane (ArrayList departList) where the parameter "departList" is passed from the Assignment6 class. The constructor layouts and organizes nodes/components in this panel. You will be adding more variables (nodes/components) than what is listed here, including Check boxes, and Labels. An object of some pane (maybe VBox) needs to be created, where check boxes will be added later on, and it needs to be added to this SelectPane. public void updateDepartList(Deaprtment newdep) This method creates an object of CheckBox using the toString method of the parameter object “newdep”. Then the check box should be added to the pane that was initially added to the SelectPane in the constructor. This class contains a nested class called  SelectionHandler class  that implements EventHandler<ActionEvent> interface. Thus you need to define its handle method that is supposed to check which check boxes are checked, and compute and update the total number of faculties of selected departments whenever one check box is checked or unchecked. GeneratePane Class: GeneratePane should contain at least the following instance variables: Attribute Name Attribute Type Description departLList ArrayList A list of department objects selectPane SelectPane An object of SelectPane public GeneratePane(ArrayList departList, SelectPane selectPane) where the parameter "departList" is passed from the Assignment6 class and the second parameter is an object of SelectPane. The constructor layouts and organizes components in this panel. You will be adding more variables (nodes/components) than what is listed here, including labels, textfields, a button, and a text area. This class contains a nested class called  ButtonHandler class  that implements EventHandler<ActionEvent> interface. Thus, the ButtonHandler needs to have a definition for handle method that adds some information for a department object to the list and does error handling. See the UML class diagram for the parameter and return type of this method. In the handle method, you need to extract the information from the textfields. Then you can instantiate an object of the Department class and set its variable values using these values from the textfields. You can use the toString( ) method of the
Club object to display the information on the textarea on the right hand side and also add the department object to the "departList". Assignment6 class: Assignment6 extends Application defined in javafx.application package and should initialize itself by setting its size. It contains at least following instance variables: Attribute Name Attribute Type Description departList ArrayList a list of club objects. It will be used in both GeneratePane and GeneratePane. selectPane SelectPane An object of SelectPane generatePane CreatePane An object of Generate pane tabPane TabPane an object of TabPane. It will contain selectPane and generatePane under each tab. Grading Policy: submit assignment on time indicate assignment number, name, lecture time, and description of each class clearly in each submitted java file 5 pts - Documentation (header with your name, your information, and program description for every class/file and comment/description within your code for every method) 1 pt - Indentation and spacing (easy to read) 6 pts - Required classes/methods and functionalities implemented 8 pts - Your program minimally need to have the following functionalities: 1. 2 points: Appropriate components such as text fields, labels, etc. are shown under the "Add Department" and "Select Department" tabs. 2. 1 point: When the "Add a Department" button is pushed, the department information is added on the right panel in the correct order and the message of "Department added" shows up, and the textfields are cleared. 3. 1 point: Error handing in case some field is not filled. 4. 1 point: Error handing in case non-integer is entered for the number of faculties (under Add a Department). 5. 1 point: Whenever a new department is added in the add department panel, its corresponding CheckBox is added in the department selection pane. 6. 2 points: When a check box in the department selection pane is checked or unchecked, the total number of faculties for selected departments needs to be computed and updated in the label to display it.  Total points: 20   -------------------------------------------- What to turn in: -Submit your Assignment6.java, SelectPane.java, GeneratePane.java, and Department.java files
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
using Gradescope-> Assignment6 on canvas.asu.edu. Make sure that it is compiling. You can submit multiple times until the assignment deadline. Copyright © 2020, Arizona State University All rights reserved. ASU disclaimer Copying any content of this page will be a violation of the copy right.