X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fmodel%2Fwires%2FGUIWire.java;h=649ddb688f586660ed2209c8aafd765cd039c4b1;hb=f2886cbd57dd08b797921fc2421b41bd92915799;hp=d0bd9908fefed7f0671235d2ea0dc465227b46e3;hpb=4d29cabdc45d68b5e5f210266dc4fbc5560dbcdd;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 d0bd9908..649ddb68 100644 --- a/LogicUI/src/era/mi/gui/model/wires/GUIWire.java +++ b/LogicUI/src/era/mi/gui/model/wires/GUIWire.java @@ -3,6 +3,7 @@ package era.mi.gui.model.wires; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; +import era.mi.gui.model.ViewModel; import era.mi.logic.types.Bit; import era.mi.logic.wires.Wire; import net.haspamelodica.swt.helper.gcs.GeneralGC; @@ -16,7 +17,7 @@ public class GUIWire private Wire wire; - public GUIWire(Runnable redraw, Pin pin1, Pin pin2, Point... path) + public GUIWire(ViewModel model, Pin pin1, Pin pin2, Point... path) { this.path = new double[path.length * 2 + 4]; for (int srcI = 0, dstI = 2; srcI < path.length; srcI++, dstI += 2) @@ -32,6 +33,8 @@ public class GUIWire pos = pin2.getPos(); this.path[this.path.length - 2] = pos.x; this.path[this.path.length - 1] = pos.y; + + model.wireCreated(this); } public void render(GeneralGC gc)