Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in JAVA ******* The buttons show a snow man and a car, respectively. Snowmen and cars are composite shapes. When a button is clicked, the

in JAVA *******image text in transcribed

The buttons show a snow man and a car, respectively. Snowmen and cars are composite shapes. When a button is clicked, the shape inside the button becomes the current shape. The current shape should be recognized by a visible bounding box surrounding it. The bound box doesn't have to be an exact bounding box of the shape. When the mouse is pressed on the user-defined panel, the current shape is drawn at the position where the mouse was pressed. Design the application to satisfy the following requirements: The program should be reusable for any composite shape . The user-defined JPanel should delegate the drawing function to the composite shape . There should be at least one is-a relationship through an interface There should be at least one is-a relationship through inheritance There should be at least one has-a relationship. The following figure shows the output of the application after three snowmen were drawn when it was the current shape, and then the current shape was changed to the car and was drawn four times Shape Displayer After ensuring that the program works correctly with these two buttons, add one more button with an icon of a composite shape of your choice. The new composite shape of your choice should consist of at least 3 different primitive shapes such as Rectangles. Ellipses, and Lines, etc The buttons show a snow man and a car, respectively. Snowmen and cars are composite shapes. When a button is clicked, the shape inside the button becomes the current shape. The current shape should be recognized by a visible bounding box surrounding it. The bound box doesn't have to be an exact bounding box of the shape. When the mouse is pressed on the user-defined panel, the current shape is drawn at the position where the mouse was pressed. Design the application to satisfy the following requirements: The program should be reusable for any composite shape . The user-defined JPanel should delegate the drawing function to the composite shape . There should be at least one is-a relationship through an interface There should be at least one is-a relationship through inheritance There should be at least one has-a relationship. The following figure shows the output of the application after three snowmen were drawn when it was the current shape, and then the current shape was changed to the car and was drawn four times Shape Displayer After ensuring that the program works correctly with these two buttons, add one more button with an icon of a composite shape of your choice. The new composite shape of your choice should consist of at least 3 different primitive shapes such as Rectangles. Ellipses, and Lines, etc

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

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago