Components now can be clicked
[Mograsim.git] / LogicUI / src / era / mi / components / gui / BasicGUIComponent.java
index 925fe4b..54384b9 100644 (file)
@@ -16,6 +16,13 @@ public interface BasicGUIComponent
         * Used for calculating which component is clicked.
         */
        public Rectangle getBounds();
+       /**
+        * Called when this component is clicked. Relative coordinates of the click are given.
+        */
+       public default boolean clicked(double x, double y)
+       {
+               return false;
+       }
 
        //TODO this code will be replaced by code in BasicComponent.
        /**