X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fmodel%2Fwires%2FGUIWire.java;h=112133595601a90c139626aafa3382354bd68df3;hb=8eb61f917f31b0cff935538606df04e1c610bdf9;hp=649ddb688f586660ed2209c8aafd765cd039c4b1;hpb=f2886cbd57dd08b797921fc2421b41bd92915799;p=Mograsim.git diff --git a/LogicUI/src/era/mi/gui/model/wires/GUIWire.java b/LogicUI/src/era/mi/gui/model/wires/GUIWire.java index 649ddb68..11213359 100644 --- a/LogicUI/src/era/mi/gui/model/wires/GUIWire.java +++ b/LogicUI/src/era/mi/gui/model/wires/GUIWire.java @@ -11,6 +11,7 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Point; public class GUIWire { + private final ViewModel model; private Pin pin1; private Pin pin2; private double[] path; @@ -19,6 +20,7 @@ public class GUIWire public GUIWire(ViewModel model, Pin pin1, Pin pin2, Point... path) { + this.model = model; this.path = new double[path.length * 2 + 4]; for (int srcI = 0, dstI = 2; srcI < path.length; srcI++, dstI += 2) { @@ -37,6 +39,11 @@ public class GUIWire model.wireCreated(this); } + public void destroy() + { + model.wireDestroyed(this); + } + public void render(GeneralGC gc) { Color oldFG = gc.getForeground();