X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fmodel%2Fcomponents%2FGUIComponent.java;h=cf9b23a2116909a347008f39bc05dff0f6612a95;hb=f2886cbd57dd08b797921fc2421b41bd92915799;hp=7f4107d76f701f599be61da521f56da3a0de24b5;hpb=4a6a0a2c85c1a16112efaf7ca6d2b5fba3c9b466;p=Mograsim.git diff --git a/LogicUI/src/era/mi/gui/model/components/GUIComponent.java b/LogicUI/src/era/mi/gui/model/components/GUIComponent.java index 7f4107d7..cf9b23a2 100644 --- a/LogicUI/src/era/mi/gui/model/components/GUIComponent.java +++ b/LogicUI/src/era/mi/gui/model/components/GUIComponent.java @@ -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) {