Answered step by step
Verified Expert Solution
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 *******
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, etcStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started