X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fwires%2FGUIWire.java;h=870be5bcda2ab9115137b287eea0a5636f3f66fb;hb=97a2f7c297bf2aa814cfc06a8eca1c7b452a4377;hp=c8f6217ccd72fe20b11b260a7b9e14ea60e9e2b7;hpb=e8e95e2e345f4d9c5927aa78f5c0fb607d352a97;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/GUIWire.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/GUIWire.java index c8f6217c..870be5bc 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/GUIWire.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/GUIWire.java @@ -18,6 +18,7 @@ import net.mograsim.logic.core.wires.Wire.ReadEnd; import net.mograsim.logic.model.model.ViewModelModifiable; import net.mograsim.preferences.ColorDefinition; import net.mograsim.preferences.ColorManager; +import net.mograsim.preferences.Preferences; /** * A wire connecting exactly two {@link Pin}s. @@ -252,18 +253,18 @@ public class GUIWire recalculateEffectivePath(); - model.wireCreated(this); + model.wireCreated(this, this::destroyed); } /** - * Destroys this wire. This method implicitly calls {@link ViewModelModifiable#wireDestroyed(GUIWire) wireDestroyed()} for the model - * this component is a part of. + * Destroys this wire. This method is called from {@link ViewModelModifiable#wireDestroyed(GUIWire) wireDestroyed()} of the model this + * wire is a part of. * * @author Daniel Kirschten */ - public void destroy() + private void destroyed() { - model.wireDestroyed(this); + // nothing to do } // pins @@ -367,7 +368,10 @@ public class GUIWire ColorDefinition wireColor = BitVectorFormatter.formatAsColor(end); if (wireColor != null) gc.setForeground(ColorManager.current().toColor(wireColor)); + gc.setLineWidth( + Preferences.current().getDouble("net.mograsim.logic.model.linewidth.wire." + (logicWidth == 1 ? "singlebit" : "multibit"))); gc.drawPolyline(effectivePath); + gc.setLineWidth(Preferences.current().getDouble("net.mograsim.logic.model.linewidth.default")); } // operations concerning the path