X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fwires%2FWireCrossPoint.java;h=5751596949f4b87e0f5ec9fa847dc5aa83b70479;hb=0a0877d1d0fca51260e66d65da3636752ded4242;hp=49faee9c9dc249ac2b135aa213a0d8b93bae4ba6;hpb=3977f16649531ca3ba345c9cd5ec365e0b804783;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/WireCrossPoint.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/WireCrossPoint.java index 49faee9c..57515969 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/WireCrossPoint.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/WireCrossPoint.java @@ -29,6 +29,10 @@ public class WireCrossPoint extends GUIComponent private static final int CIRCLE_RADIUS = 1; private static final int CIRCLE_DIAM = CIRCLE_RADIUS * 2; + /** + * The logical width of this cross point. + */ + public final int logicWidth; /** * The (single) pin of this cross point. */ @@ -53,10 +57,11 @@ public class WireCrossPoint extends GUIComponent public WireCrossPoint(ViewModelModifiable model, int logicWidth, String name) { super(model, name); - logicObs = (i) -> requestRedraw(); + this.logicWidth = logicWidth; + logicObs = (i) -> model.requestRedraw(); setSize(CIRCLE_DIAM, CIRCLE_DIAM); - addPin(this.pin = new Pin(this, "", logicWidth, CIRCLE_RADIUS, CIRCLE_RADIUS)); + addPin(this.pin = new Pin(this, "", logicWidth, PinUsage.TRISTATE, CIRCLE_RADIUS, CIRCLE_RADIUS)); } // pins @@ -118,7 +123,7 @@ public class WireCrossPoint extends GUIComponent @Override public JsonElement getParamsForSerializing(IdentifierGetter idGetter) { - return new JsonPrimitive(pin.logicWidth); + return new JsonPrimitive(logicWidth); } static