LogicUICanvas now uses the new listener system; changes in clicked()
[Mograsim.git] / LogicUI / src / era / mi / gui / model / components / GUIComponent.java
index 7f4107d..cf9b23a 100644 (file)
@@ -33,6 +33,8 @@ public abstract class GUIComponent
                this.componentMovedListeners = new ArrayList<>();
                this.pinAddedListeners = new ArrayList<>();
                this.pinRemovedListeners = new ArrayList<>();
+
+               model.componentCreated(this);
        }
 
        public void moveTo(double x, double y)
@@ -50,9 +52,9 @@ public abstract class GUIComponent
                return new Rectangle(bounds.x, bounds.y, bounds.width, bounds.height);
        }
 
-       // TODO
        /**
-        * Called when this component is clicked. Relative coordinates of the click are given. Returns true if this component has to be redrawn.
+        * Called when this component is clicked. Absolute coordinates of the click are given. Returns true if this component consumed this
+        * click.
         */
        public boolean clicked(double x, double y)
        {