Question: [JAVA] Write a JavaFX program which implements Composite design patternUse JavaFX mouse event handler to create objects(circles and rectangles) on a canvas (your JavaFX stage)
[JAVA]
Write a JavaFX program which implements Composite design patternUse JavaFX mouse event handler to create objects(circles and rectangles) on a canvas (your JavaFX stage) using your mouse. Then extend your code to implement the composite design pattern which dragging a container moves all circles within it.
Please don't use any extra packages that are not standard in java
Functionality Requirements
1)Your program shall allow user to add black circles by primary click action and add randomly colored rectangles by right clicking.
2)Your program shall allow user to drag a black circle into a rectangular container.
3)Your program shall changes the color of the circle to its containers color once it is placed within a container.
4)Your program shall drag all circles within a container with it if the container is dragged.
It should look something like this:
![[JAVA] Write a JavaFX program which implements Composite design patternUse JavaFX mouse](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f501ff2b99e_86266f501fea8be9.jpg)
Shape Composer ?? X
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
