Define the scene that contains the pane

Assignment Help Computer Engineering
Reference no: EM133694950

Question: A point is considered maximal if there are no other points above it or to the right of it. ?The maximal points are to be connected by lines as shown in the above example. Initially the set of points is to be read from a file whose name can be hard-coded. The following input file should produce the above window:

200.0 300.0

250.0 300.0

330.0 270.0

150.0 380.0

126.0 172.0

397.0 379.0

334.0 441.0

53.0 288.0

89.0 433.0

182.0 215.0

251.0 414.0

After the initial set of points have been read in, the point set should be able to be modified with the mouse. Clicking the left mouse button should add a point at the clicked location and a right click should remove a point. After a point has been either added or removed, a new set of maximal points should be determined and connected with lines.

This program should consist of three classes. The first class should have two instance variables of type double that represent the x and y coordinates of the point. It should be an immutable class the implements the Comparable interface with the following public methods:

A constructor that initializes the x and y coordinates of the point
A method that returns the x ordinate
A method that returns the y ordinate
A method that is passed a second point and returns true if the second point is below and to the left of the point on which it is invoked and false otherwise
A compareTo method that compares only the x ordinates of the two points

The second class should extend the javafx Pane class. It should contain the following methods:

A constructor that is supplied an array list of points that produces the initial point set and determines the maximal points and connects them
A private event handler that handles mouse clicks that adds a point with a left click, removes a point with a right click and recomputes the maximal point set afterward
A private method that finds the maximal set and draws the lines that connect them

The method that compares whether a point is below and to the left of another should be used to determine which points are in the maximal set. The compareTo method should be used to sort the maximal set of points so that they can be connected. You can use the predefined sort method in the Collections class to perform the sort. The pane should be 500 pixels by 500 pixels.

The third class defines the scene that contains the pane which is created with the initial set of points that are read in from the file points.txt by the main method.

Reference no: EM133694950

Questions Cloud

What would be good questions to ask the coordinator : what would be good questions to ask the coordinator of the program that can help you figure out what kind of educational information you can present
Describe the architecture that you selected : Describe the architecture that you selected. Why do you feel that this architecture is appropriate for the application that you are designing for your project?
Compose an article discussing pro or con pertaining : Compose an article discussing pro or con pertaining the concept of data redundancy in database management. At least four paragraph.
How to compute a preimage of a hash : Shows how to compute a preimage of a hash in a modified form of SHA-3, where there are no c-bits. In other words, assume r=1600 and c=0, but otherwise,
Define the scene that contains the pane : Define the scene that contains the pane which is created with the initial set of points that are read in from the file points.txt by the main method
Describe the components of care planning within that setting : Identify and explain the key factors that must be considered in the care planning process. Include the role of assessment in developing the care plan.
Identify one sustainable development goal : Sustainable Development Goal: Identify one Sustainable Development Goal (SDG) that aligns with the issue and the proposed intervention.
What is the correct sequence of phases involved : Execution Environment phase Pre-EFI initialization phase Runtime phase What is the correct sequence of phases involved in the UEFI boot process
What would a controlled experiment entail in this context : negative correlation with study? Thus, comment on the unbiasedness of ?;, which is the OLS estimator of f; calculated from a random sample data

Reviews

Write a Review

Computer Engineering Questions & Answers

  Questionthe small business that you created new domain

questionthe small business that you created new domain controllers for now wants you to develop a backup and recovery

  How the architecture can allow for options

In a system familiar to you, discuss how the architecture can allow for options to respond to changes in client demands.

  A brief report concerning threat of privacy

COM 510 University of South Florida A brief report concerning threat of privacy, with a relevance article, issues raised and opinion of the issue with reason

  Provide some command line parsing capability to extract

list the current directory contents, you will need to provide some command line parsing capability to extract the target directory for listing.

  A variety of both technical and business skill sets

An effective project manager wants a variety of both technical and business skill sets. recognize the nontechnical skills that have been associated with superior project management.

  How can quicksort be altered so that it can be applied

How can quicksort be altered so that it can be applied on a doubly-linked list?

  Write an application that retrieves a student name

Write an application that retrieves a student name and three scores per line from a text file. Process values by calculating the average of scores per student.

  Specify the most significant merits and demerits that could

write a two to three 2-3 page paper in which you 1 specify the most significant advantages and disadvantages that could

  Compare the problem space with the solution space

Compare and contrast the problem space with the solution space.What is the relationship between product specifications and requirements?

  Discuss the unique challenges that an it project presents

What is a project, and what are its main attributes? How is a project different from what most people do in their day-to-day jobs? Discuss the importance.

  How can the use of security policies reduce risk

A tenet of telecommunications says the more people who access a network, the more valuable the network becomes. This is called Metcalfe's Law.

  Explain the application of query design

IT 655- Explain the application of query design and how queries can be made more efficient, in general, according to industry best practices. Your discussion should specifically touch upon, at minimum, sub-queries, and sorting.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd