Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a JavaFX program named RectangledCircles that enables the user to add and remove points in a two-dimensional plane dynamically. A minimum bounding rectangle is

Write a JavaFX program named RectangledCircles that enables the user to add and remove points in a two-dimensional plane dynamically. A minimum bounding rectangle is updated as the points are added and removed. Assume that the radius of each point is 10 pixels. Here is an algorithm for the mouse event triggered:

MousePressed event triggered

If Primary mouse button pressed

Create a new circle at the location pressed

Else if Secondary mouse button pressed

Get a list of all the circles on the screen

If current location pressed is inside (use contains method) a circle

Remove the circle

End if

End if

Get the X and Y coordinates of all the circle centers

Find the max and min of all X and Y values

Set the coordinates and length/width of the bounding rectangle according to the min and max values

End mousePressed event

image text in transcribed

Rectangled Circles INSTRUCTION Add: Left Click Remove: Right Click

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g Database Administrator Implementation And Administration

Authors: Gavin Powell, Carol McCullough Dieter

2nd Edition

1418836656, 9781418836658

More Books

Students also viewed these Databases questions

Question

Have you defined the situation fairly and accurately?

Answered: 1 week ago

Question

107 MA ammeter 56 resistor ? V voltmeter

Answered: 1 week ago

Question

Generally If Drug A is an inducer of Drug B , Drug B levels will

Answered: 1 week ago

Question

2. If you were Don, what action would you take?

Answered: 1 week ago