X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fmodel%2Fcomponents%2FGUIComponent.java;h=e266afbf6eee065506e4ef3290e4f6cc5eb60b77;hb=8eb61f917f31b0cff935538606df04e1c610bdf9;hp=cf9b23a2116909a347008f39bc05dff0f6612a95;hpb=f2886cbd57dd08b797921fc2421b41bd92915799;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 cf9b23a2..e266afbf 100644 --- a/LogicUI/src/era/mi/gui/model/components/GUIComponent.java +++ b/LogicUI/src/era/mi/gui/model/components/GUIComponent.java @@ -37,6 +37,12 @@ public abstract class GUIComponent model.componentCreated(this); } + public void destroy() + { + pins.forEach(p -> pinRemovedListeners.forEach(l -> l.accept(p))); + model.componentDestroyed(this); + } + public void moveTo(double x, double y) { bounds.x = x;