Chat with us, powered by LiveChat I need help to complete my two file classes. ( InputPane and Han | Wridemy

I need help to complete my two file classes. ( InputPane and Han

I need help to complete my two file classes. ( InputPane and HandlePane ).

The two other classes are already completed (Assignment5 and Order).

// Assignment #: Arizona State University CSE205 #5 // Name: Your Name // StudentID: Your ID // Lecture: Your lecture time (e.g., MWF 8:35am) // Description: InputPane generates a pane where a user can enter // a new order information and create a list of available Orders. // //—- is where you need to add your own codes import java.util.ArrayList; import javafx.scene.layout.HBox; import javafx.event.ActionEvent; import javafx.event.EventHandler; //import all other necessary javafx classes here //—- public class InputPane extends HBox { //components ArrayList<Order> orderList; //The relationship between InputPane and HandlePane is Aggregation private HandlePane handlePane; //declare other necessary GUI components and variables here //—- //constructor public InputPane(ArrayList<Order> list, HandlePane pane) { this.orderList = list; this.handlePane = pane; //initialize each instance variable (textfields, labels, textarea, button, etc.) //and set up the layout //—- //register source object with event handler //—- } //end of constructor //Step 2: Create a ButtonHandler class //ButtonHandler listen to see if the button "Place an order" is pushed or not, //When the event occurs, it get an order's product name, seller name, quantiy, unit price //from the relevant text fields, then create a new Order object and add it inside //the orderList. Meanwhile it will display the order's total cost and other info. inside the text area. //It also does error checking in case any of the textfields are empty private class ButtonHandler implements EventHandler<ActionEvent> { //Override the abstact method handle() public void handle(ActionEvent e) { //declare any necessary local variables here //— //when one text field is empty and the button is pushed //display msg "Please fill all fields" if ( //—- ) { //handle the case here } else { //when a non-numeric value was entered for quantity or price //and the button is pushed //you will need to use try & catch block to catch //the NumberFormatException //—- //When a duplicated order was attempted to be added, do not //add it to the list. Instead displaying msg "Order not added – duplicate" //—- } } //end of handle() method } //end of ButtonHandler class }

,

// Assignment #: Arizona State University CSE205 #5 // Name: Your Name // StudentID: Your ID // Lecture: Your lecture time (e.g., MWF 8:35am) // Description: HandlePane displays a list of available new Orders // and cancelled order. It also shows their total amounts import javafx.scene.control.ListView; import javafx.scene.control.SelectionMode; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.scene.layout.HBox; import javafx.event.ActionEvent; //**Need to import import javafx.event.EventHandler; //**Need to import import java.util.ArrayList; import java.text.DecimalFormat; //import all other necessary javafx classes here //—- public class HandlePane extends HBox { //One for the new Order list, one for the cancelled list private ArrayList<Order> orderedList, cancelledList; private ListView<Order> orderedLV, cancelledLV; //declare other necessary GUI components and variables here //—- DecimalFormat fmt1 = new DecimalFormat("##,###.00"); //Constructor public HandlePane(ArrayList<Order> list) { this.orderedList = list; //The right hand side cancelled list is empty at beginnig cancelledList = new ArrayList<Order> (); //initialize other GUI components and set up the layout here //—- //Create the two ListView objects. The left one is for new order //and the right one is for cancelled order. Study our sample codes //to learn how //—- //set up the layout of the left pane, leftPane contains label, ListView //for new orders and total ordered amounts. //—- //set up the layout of the right pane, rightPane contains label, ListView //for cancelled orders and total cancelled amounts. //—- //create a vertical TitlePane that hold the two buttons, set up the layout //—- //HandlePane is a HBox, add sub components inside HandlePane //—- //Step #3: Register the button with its handler class //—- } //end of constructor //This method refresh the new order ListView whenever there's new Order added //in InputPane. It will (1)update the underline ObservableList object; (2) //update the total ordered amount. public void updateOrderList(Order newOrder) { //—- } //Step #2: Create a ButtonHandler class private class ButtonHandler2 implements EventHandler < ActionEvent > { //Override the abstact method handle() public void handle(ActionEvent e) { //—- } } //end of ButtonHandler class } //end of HandlePane class

,

// Assignment #: Arizona State University CSE205 #5 // Name: your name // StudentID: your id // Lecture: your lecture time (e.g., MWF 8:35am) // Description: The Order class represent an order info. // this includes product name, quantity, price and total cost. import java.text.DecimalFormat; public class Order { private String productName; private String sellerName; private int quantity; private double unitPrice, totalCost; //Constructor. It initializes all instance variables to their default values. public Order() { productName = new String("?"); sellerName = new String("?"); quantity = 0; unitPrice = 0; totalCost = 0.0; } //Overloaded constructor, used to initialize all instance varibles public Order(String name, String sName, int qty, double price) { productName = name; sellerName = sName; quantity = qty; this.unitPrice = price; totalCost = quantity * unitPrice; } //Accessor method of the instance variable productName public String getProductName() { return productName; } //Accessor method of the instance variable sellerName public String getSellerName() { return sellerName; } //Accessor method of the instance variable quantity public int getQuantity() { return quantity; } //Accessor method of the instance variable unitPrice public double getUnitPrice() { return unitPrice; } //Accessor method of the instance variable totalCost public double getTotalCost() { return totalCost; } //Mutator method of the instance variable productName public void setProductName(String name) { productName = name; } //Mutator method of the instance variable productName public void setSellerName(String name) { sellerName = name; } //Mutator method of the instance variable quantity public void setModel(int qty) { quantity = qty; } //Mutator method of the instance variable unitPrice public void setUnitPrice(double price) { unitPrice = price; } //Mutator method of the instance variable totalCost //Note: totalCost will be computed and set by quantity*unitPrice public void setTotalCost() { totalCost = getQuantity() * getUnitPrice(); } //toString method creates a string containing values of //instance variables using the specified format and returns it public String toString() { DecimalFormat fmt1 = new DecimalFormat("$0.00"); String result = "Name:tt" + productName + "nSeller Name:tt" + sellerName + "nQuantity:tt" + quantity + "nPrice:tt" + fmt1.format(unitPrice) + "nTotal Cost:t" + fmt1.format(totalCost) + "nn"; return result; } } //end of the Order class

,

// Assignment #: Arizona State University CSE205 #5 // Name: Your Name // StudentID: Your ID // Lecture: Your lecture time (e.g., MWF 8:35am) // Description: The Assignment5 class creates a Tabbed Pane with // two tabs, one for Order input and one for // Order handling. import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.Tab; import javafx.scene.control.TabPane; import javafx.scene.layout.StackPane; import java.util.ArrayList; public class Assignment5 extends Application { private TabPane tabPane; private InputPane inputPane; private HandlePane handlePane; private ArrayList < Order > orderList; public void start(Stage stage) { StackPane root = new StackPane(); //orderList to be used in both InputPane & HandlePane orderList = new ArrayList < Order > (); handlePane = new HandlePane(orderList); inputPane = new InputPane(orderList, handlePane); tabPane = new TabPane(); Tab tab1 = new Tab(); tab1.setText("Order Input"); tab1.setContent(inputPane); Tab tab2 = new Tab(); tab2.setText("Order Handle"); tab2.setContent(handlePane); tabPane.getSelectionModel().select(0); tabPane.getTabs().addAll(tab1, tab2); root.getChildren().add(tabPane); Scene scene = new Scene(root, 580, 400); stage.setTitle("Order Handling Apps"); stage.setScene(scene); stage.show(); } public static void main(String[] args) { launch(args); } }

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Wridemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

Hire a tutor today CLICK HERE to make your first order

Related Tags

Academic APA Writing College Course Discussion Management English Finance General Graduate History Information Justify Literature MLA