Your task is to complete various exercises in Netbeans, using the Java language, and to submit these via the MySCU link created for this purpose.
Marking criteria includes:
• Use of correct coding style, including the use of comments;
• Accuracy of coding;
• Use of suitable coding structures;
• Correct submission and naming conventions of assessment items as required.
Getting Help
This assignment is to be completed individually. It is the opportunity to gain an understanding of the concepts of object oriented programming and coding syntax. It is important that you master these concepts yourself. You are permitted to work from the examples in the study guide or textbook but you must acknowledge assistance from other textbooks or classmates. In particular, you must not use online material or help from others, as this would prevent you from mastering these concepts.
Who can you get help from? Use this diagram to determine from whom you may seek help with your program.
Lecturer Tutors Online Forums
Relatives Students outside unit Hired coders
Classmates Private Tutors Other
Encouraged
Attribution Required
Ask tutor
Not acceptable
Please Note for all parts of the assignment:
• You cannot use the same examples that the Study guide uses. Examples taken from the study guide will result in no marks and may count as plagiarism.
• Marks will be given for high cohesion. This means that you should not have all your code in the start method.
• If your marker has any suspicion that you had help with your code or that your work is not your own you will be asked to come to a meeting with your marker to explain your code. Any student who is unable to explain their code will be submitted for academic misconduct.
Part 1 –Shapes and Events
Create a new JavaFX project called firstName_lastName_Part1 in Netbeans. In my case, the project would be called Alex_Hendry_Part1.
Using a BorderPane:
• Add at least 4 different shapes to your app (Every shape must have at least 1 event)
Your app must:
• Demonstrate the use of at least 4 different Mouse events
• Demonstrate the use of at least 2 different Key events
• Demonstrate the use of a GridPane in one section of the BorderPane
• Demonstrate the use of a FlowPane in one section of the BorderPane
• Demonstrate the use of at least 1 inner class
• Demonstrate the use of at least 1 anonymous inner class
• Demonstrate the use of at least 1 lambda expression
• Demonstrate the use of setHgap, setVgap, setHalignment and setValignment
• Marks will be given for cohesion i.e. you should not have all of your code in the start method. You should make use of multiple methods, each with a distinct function. Ideally you should have a method for each shape.
Part 2 – Images and Animations
Create a new JavaFX project called firstName_lastName_Part2 in Netbeans. In my case, the project would be called Alex_Hendry_Part2.
• Add an image as the background for your app using an ImageView object
• Demonstrate the use of at least 3 methods of ImageView
• Add a Polygon with at least 8 sides o Demonstrate the use of the FadeTransition class to fade the polygon in and out
• Add a second shape (can be any shape) o Demonstrate the use of the PathTransition class using the second shape as the path and any shape as the node
• Add a third shape (can be any shape) o Demonstrate the use of the Timeline class to change the colour of the third shape every 1 second indefinitely e.g., red to blue to red to blue to red to blue etc. You can choose whatever colours you like
Part 3 – UI Controls and Collections
Create a new JavaFX project called firstName_lastName_Part3 in Netbeans. In my case, the project would be called Alex_Hendry_Part3.
For this part of the assignment, you need to build an app that stores a collection of Students (see attached class at the end of this assignment). Your app will allow the user to enter data about a student. When the user is finished the data will be written to a Student object and then the Student object will be added to an ArrayList. The user can then enter data for a new Student and repeat the process.
Your app will need the following UI controls that will be mapped to instance variables in the Student Class provided at the end of this document:
• Text field for the first name
• Text field for the last name
• Slider for the age
• Radio buttons for the gender
• Check boxes for the subjects the student has completed (add at least 4 subjects from the IT degree)
• A list view for the programming languages the student likes (at least 4 programming languages)
Once a user has entered the data for a student your app needs to do the following:
• Write the data from the UI to a Student object (use the attached class at the end of this assignment)
• Add the Student object to an ArrayList that will store all students entered by the user
• Reset the UI controls so the user can enter a new Student
One way to do this would be to have the following (you do not have to do it this way):
• A “New Student” button that resets the UI controls.
• An “Add Student” button that creates a new instance of the Student, sets the Students instance variables (via the mutator methods) using the values from the UI controls and then adds the Student to the ArrayList
PLEASE NOTE:
• Marks will be given for cohesion i.e. you should not have all of your code in the start method. You should make use of multiple methods, each with a distinct function
• You CANNOT modify the attached Student class
Submission
You should now have 3 Netbeans projects. You must zip the projects into one zip file called firstName_lastName_A2.zip For example, mine would be alex_hendry_A2.zip.
Submit this file via the Assignment 2 link on MySCU by the due date. Please leave enough time for it to upload, so do not submit at the last minute!
Student Class
Use the following class for your Student:
public class Student { // text field
private String firstName;
// text field
private String lastName;
// slider private Integer age; // radio buttons private String gender; // check boxes
private HashSet String subjects = new HashSet();
// list view
private HashSet String programmingLanguages = new HashSet();
public Student() {
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public void setLastName(String lastName) { this.lastName = lastName;
}
public void setAge(Integer age) {
this.age = age;
}
public void setGender(String gender) {
this.gender = gender;
}
public void setSubjects(HashSet String subjects) {
this.subjects = subjects;
}
public void setProgrammingLanguages(HashSet String programmingLanguages) { this.programmingLanguages = programmingLanguages;
}
}