Assignment6

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

You can look at the Java programs in the text book to see how comments are added to programs.

Minimal Submitted Files

You are required, but not limited, to turn in the following source files:

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Assignment6.java (No need to modify) 

Movie.java (No need to modify, modified version from the assignment 4)

Review.java (No need to modify) 

CreatePane.java – to be completed

ReviewPane.java – to be completed

You might need to add more methods than the specified ones.

Skills to be Applied:

JavaFX, ArrayList

Classes may be needed:  

Button, TextField, TextArea, Label, RadioButton, ListView, and ActionHandler. You may use other classes.

Here is the Assignmnet6.java: 

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 Assignment6 extends Application
{
   private TabPane tabPane;
   private CreatePane createPane;
   private ReviewPane reviewPane;
   private ArrayList<Movie> movieList;

   public void start(Stage stage)
   {
       StackPane root = new StackPane();

       //movieList to be used in both createPane & reviewPane
       movieList = new ArrayList<Movie>();

       reviewPane = new ReviewPane(movieList);
       createPane = new CreatePane(movieList, reviewPane);

       tabPane = new TabPane();

       Tab tab1 = new Tab();
       tab1.setText("Movie Creation");
       tab1.setContent(createPane);

       Tab tab2 = new Tab();
       tab2.setText("Movie Review");
       tab2.setContent(reviewPane);

       tabPane.getSelectionModel().select(0);
       tabPane.getTabs().addAll(tab1, tab2);

       root.getChildren().add(tabPane);

       Scene scene = new Scene(root, 700, 400);
       stage.setTitle("Movie Review Apps");
       stage.setScene(scene);
       stage.show();
   }

   public static void main(String[] args)
   {
       launch(args);
   }
}

Here is Movie.java:

public class Movie

 {

   private String movieTitle;

     private int year;

     private int length;

     private Review bookReview;

     

   //Constructor to initialize all member variables

   public Movie()

    {

      movieTitle = “?”;

      length = 0;

      year = 0;

      bookReview = new Review();

    }

   //Accessor methods

   public String getMovieTitle()

    {

      return movieTitle;

    }

   public int getLength()

    {

      return length;

    }

   public int getYear()

    {

  return year;

}

   public Review getReview()

    {

       return bookReview;

    }

   //Mutator methods

   public void setMovieTitle(String aTitle)

    {

     movieTitle = aTitle;

    }

   public void setLength(int aLength)

    {

     length = aLength;

    }

   public void setYear(int aYear)

    {

        year = aYear;

    }

   public void addRating(double rate)

     {

         bookReview.updateRating(rate);

     }

   //toString() method returns a string containg the information on the movie

   public String toString()

    {

      String result = “\nMovie Title:\t\t” + movieTitle

                    + “\nMovie Length:\t\t” + length

                    + “\nMovie Year:\t\t” + year

                    + “\n” + bookReview.toString() + “\n\n”;

      return result;

     }

  }

Here is Review.java:

import java.text.DecimalFormat;

public class Review
{
  private int numberOfReviews;
  private double sumOfRatings;
  private double average;

  //Constructor to initialize all member variables
  public Review()
   {
    numberOfReviews = 0;
    sumOfRatings = 0.0;
    average = 0.0;
   }

  //It updates the number of REviews and avarage based on the
  //an additional rating specified by its parameter
  public void updateRating(double rating)
   {
     numberOfReviews++;
     sumOfRatings += rating;
     if (numberOfReviews > 0)
      {
       average = sumOfRatings/numberOfReviews;
      }
     else
       average = 0.0;
   }

  //toString() method returns a string containg its review average
  //and te number of Reviews
  public String toString()
   {
     DecimalFormat fmt = new DecimalFormat("0.00");
     String result = "Reviews:\t" + fmt.format(average) + "("
                   + numberOfReviews + ")";
     return result;
    }
 }

Here is CreatePane.java:

import java.util.ArrayList;

import javafx.scene.layout.HBox;

//import all other necessary javafx classes here

//—-

public class CreatePane extends HBox

{

    private ArrayList<Movie> movieList;

    

    //The relationship between CreatePane and ReviewPane is Aggregation

    private ReviewPane reviewPane;

    //constructor

    public CreatePane(ArrayList<Movie> list, ReviewPane rePane)

     {

        this.movieList = list;

        this.reviewPane = rePane;

        //Step #1: initialize each instance variable and set up the layout

        //—-

        

        //create a GridPane hold those labels & text fields

        //consider using .setPadding() or setHgap(), setVgap()

        //to control the spacing and gap, etc.

        //—-

        

        

        //You might need to create a sub pane to hold the button

        //—-

        

        //Set up the layout for the left half of the CreatePane.

        //—-

        

        

        //the right half of this pane is simply a TextArea object

        //Note: a ScrollPane will be added to it automatically when there are no

        //enough space

        

        //Add the left half and right half to the CreatePane

        //Note: CreatePane extends from HBox

        //—-

        

        //Step #3: register source object with event handler

        //—-

        

    } //end of constructor

    //Step 2: Create a ButtonHandler class

    //ButtonHandler listens to see if the button “Create a Movie” is pushed or not,

    //When the event occurs, it get a movie’s Title, Year, and Length

    //information from the relevant text fields, then create a new movie and add it inside

    //the movieList. Meanwhile it will display the movie’s information inside the text area.

    //It also does error checking in case any of the textfields are empty or non-numeric string is typed

    private class ButtonHandler implements EventHandler<ActionEvent>

     {

        //Override the abstact method handle()

        public void handle(ActionEvent event)

         {

            //declare any necessary local variables here

            //—

            

            //when a text field is empty and the button is pushed

            if ( //—-  )

                {

                    //handle the case here

                    

                }

                else //for all other cases

                {

                    //—-

                    //at the end, don’t forget to update the new arrayList

                    //information on the ListView of the ReviewPane

                    //—-

                    

                    //Also somewhere you will need to use try & catch block to catch

                    //the NumberFormatException

                }

         } //end of handle() method

   } //end of ButtonHandler class

}

Here is ReviewPane.java

import javafx.scene.control.ListView;

import javafx.collections.FXCollections;

import javafx.collections.ObservableList;

import javafx.scene.layout.VBox;

import javafx.event.ActionEvent; //**Need to import to handle event

import javafx.event.EventHandler; //**Need to import to handle event

import java.util.ArrayList;

import javafx.scene.layout.HBox;

//import all other necessary javafx classes here

//—-

public class ReviewPane extends VBox

{

   private ArrayList<Movie> movieList;

   //A ListView to display movies created

   private ListView<Movie> movieListView;

   //declare all other necessary GUI variables here

   //—-

    

   //constructor

   public ReviewPane(ArrayList<Movie> list)

   {

       //initialize instance variables

       this.movieList = list;

       //set up the layout

       //—-

       

       

       //ReviewPane is a VBox – add the components here

       //—-

       

       //Step #3: Register the button with its handler class

       //—-

       

       

       

   } //end of constructor

 //This method refresh the ListView whenever there’s new movie added in CreatePane

 //you will need to update the underline ObservableList object in order for ListView

 //object to show the updated movie list

 public void updateMovieList(Movie newMovie)

 {

     //——-

 }

 //Step 2: Create a RatingHandler class

 private class RatingHandler implements EventHandler<ActionEvent>

    {

        //Override the abstact method handle()

        public void handle(ActionEvent event)

        {

            //When “Submit Review” button is pressed and a movie is selected from

            //the list view’s average rating is updated by adding a additional

            //rating specified by a selected radio button

            if (//—-)

                {

                    //—-

                    

                }

        }

    } //end of RatingHandler

} //end of ReviewPane class

What Will You Get?

We provide professional writing services to help you score straight A’s by submitting custom written assignments that mirror your guidelines.

Premium Quality

Get result-oriented writing and never worry about grades anymore. We follow the highest quality standards to make sure that you get perfect assignments.

Experienced Writers

Our writers have experience in dealing with papers of every educational level. You can surely rely on the expertise of our qualified professionals.

On-Time Delivery

Your deadline is our threshold for success and we take it very seriously. We make sure you receive your papers before your predefined time.

24/7 Customer Support

Someone from our customer support team is always here to respond to your questions. So, hit us up if you have got any ambiguity or concern.

Complete Confidentiality

Sit back and relax while we help you out with writing your papers. We have an ultimate policy for keeping your personal and order-related details a secret.

Authentic Sources

We assure you that your document will be thoroughly checked for plagiarism and grammatical errors as we use highly authentic and licit sources.

Moneyback Guarantee

Still reluctant about placing an order? Our 100% Moneyback Guarantee backs you up on rare occasions where you aren’t satisfied with the writing.

Order Tracking

You don’t have to wait for an update for hours; you can track the progress of your order any time you want. We share the status after each step.

image

Areas of Expertise

Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.

Areas of Expertise

Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.

image

Trusted Partner of 9650+ Students for Writing

From brainstorming your paper's outline to perfecting its grammar, we perform every step carefully to make your paper worthy of A grade.

Preferred Writer

Hire your preferred writer anytime. Simply specify if you want your preferred expert to write your paper and we’ll make that happen.

Grammar Check Report

Get an elaborate and authentic grammar check report with your work to have the grammar goodness sealed in your document.

One Page Summary

You can purchase this feature if you want our writers to sum up your paper in the form of a concise and well-articulated summary.

Plagiarism Report

You don’t have to worry about plagiarism anymore. Get a plagiarism report to certify the uniqueness of your work.

Free Features $66FREE

  • Most Qualified Writer $10FREE
  • Plagiarism Scan Report $10FREE
  • Unlimited Revisions $08FREE
  • Paper Formatting $05FREE
  • Cover Page $05FREE
  • Referencing & Bibliography $10FREE
  • Dedicated User Area $08FREE
  • 24/7 Order Tracking $05FREE
  • Periodic Email Alerts $05FREE
image

Services offered

Join us for the best experience while seeking writing assistance in your college life. A good grade is all you need to boost up your academic excellence and we are all about it.

  • On-time Delivery
  • 24/7 Order Tracking
  • Access to Authentic Sources
Academic Writing

We create perfect papers according to the guidelines.

Professional Editing

We seamlessly edit out errors from your papers.

Thorough Proofreading

We thoroughly read your final draft to identify errors.

image

Delegate Your Challenging Writing Tasks to Experienced Professionals

Work with ultimate peace of mind because we ensure that your academic work is our responsibility and your grades are a top concern for us!

Check Out Our Sample Work

Dedication. Quality. Commitment. Punctuality

Categories
All samples
Essay (any type)
Essay (any type)
The Value of a Nursing Degree
Undergrad. (yrs 3-4)
Nursing
2
View this sample

It May Not Be Much, but It’s Honest Work!

Here is what we have achieved so far. These numbers are evidence that we go the extra mile to make your college journey successful.

0+

Happy Clients

0+

Words Written This Week

0+

Ongoing Orders

0%

Customer Satisfaction Rate
image

Process as Fine as Brewed Coffee

We have the most intuitive and minimalistic process so that you can easily place an order. Just follow a few steps to unlock success.

See How We Helped 9000+ Students Achieve Success

image

We Analyze Your Problem and Offer Customized Writing

We understand your guidelines first before delivering any writing service. You can discuss your writing needs and we will have them evaluated by our dedicated team.

  • Clear elicitation of your requirements.
  • Customized writing as per your needs.

We Mirror Your Guidelines to Deliver Quality Services

We write your papers in a standardized way. We complete your work in such a way that it turns out to be a perfect description of your guidelines.

  • Proactive analysis of your writing.
  • Active communication to understand requirements.
image
image

We Handle Your Writing Tasks to Ensure Excellent Grades

We promise you excellent grades and academic excellence that you always longed for. Our writers stay in touch with you via email.

  • Thorough research and analysis for every order.
  • Deliverance of reliable writing service to improve your grades.
Place an Order Start Chat Now
image

Order your essay today and save 30% with the discount code ESSAYHELP