Reference no: EM13332265
1. Create a Draggableinterface that specifies a single method:
boolean mouseDragged(int mouseX, int mouseY);
2. Write a mouseDraggedmethod in the Guiclass. The method is not very long: just check if the selected Clickableinstance is a Draggableinstance. If it is, then call the mouseDraggedmethod on it.
3. Add a mouseDraggedfunction to the main file. It is nearly identical to the mousePressed& mouseReleasedmethods.
4. Create a DraggableRectangleclass that implements this method. See Lab 5: Drag & Dropfor details of how to do this. The idea behind the lab exercise is what you need, not the exact code. The code will be different because this is not Wheels.
5. Create a ColorButtonclass that extends Button. The ColorButtonshould not have any text in it, but it should be of a certain specified color. When it is pressed, it should change the color of a DraggableRectangle. The ColorButtonconstructor should accept a DraggableRectangleand a color. See HW 03: Moving robotsfor details of how to attach a button to another shape.
6. Place two ColorButtoninstances on the screen (leave the button from parts 1-19 there too) and a single DraggableRectangleinstance. The two ColorButtonsmust change the color of the DraggableRectangle.