Question: 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 *******in JAVA ******* The buttons show a snow man and a car,

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!