X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fcomponents%2Fatomic%2FGUIBitDisplay.java;fp=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fcomponents%2Fatomic%2FGUIBitDisplay.java;h=b82d5265de8e1638d5bb4e2c7672e8ebbae7058d;hb=8c26f70ef8444eae412b35805de3fd43fe3ef345;hp=c837fd44274aabf2e8b7d37e1a225904e055068c;hpb=bece76750849d1c9374aaa3772dcad552527f60b;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIBitDisplay.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIBitDisplay.java index c837fd44..b82d5265 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIBitDisplay.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/GUIBitDisplay.java @@ -28,18 +28,18 @@ public class GUIBitDisplay extends GUIComponent private final LogicObserver logicObs; private BitDisplay bitDisplay; - public GUIBitDisplay(ViewModelModifiable model) + public GUIBitDisplay(ViewModelModifiable model, int logicWidth) { - this(model, null); + this(model, logicWidth, null); } - public GUIBitDisplay(ViewModelModifiable model, String name) + public GUIBitDisplay(ViewModelModifiable model, int logicWidth, String name) { super(model, name); logicObs = (i) -> model.requestRedraw(); setSize(width, height); - addPin(this.inputPin = new Pin(this, "", 1, 0, height / 2)); + addPin(this.inputPin = new Pin(this, "", logicWidth, 0, height / 2)); } @Override @@ -89,6 +89,7 @@ public class GUIBitDisplay extends GUIComponent static { ViewLogicModelAdapter.addComponentAdapter(new BitDisplayAdapter()); - IndirectGUIComponentCreator.setComponentSupplier(GUIBitDisplay.class.getCanonicalName(), (m, p, n) -> new GUIBitDisplay(m, n)); + IndirectGUIComponentCreator.setComponentSupplier(GUIBitDisplay.class.getCanonicalName(), + (m, p, n) -> new GUIBitDisplay(m, p.getAsInt(), n)); } } \ No newline at end of file