X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2Fatomic%2FGUINandGate.java;h=78b163923e05c4e9e14d66e67eaaed289520a892;hb=5ece0acf049bf9af2933f513fe0206565681f622;hp=359a6f63c468d6ff3b80fd4fa8fc70b39d594d8f;hpb=5897a6d81c418d27ca5bb402e5f1038e10a191fb;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/atomic/GUINandGate.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/atomic/GUINandGate.java index 359a6f63..78b16392 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/atomic/GUINandGate.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/atomic/GUINandGate.java @@ -10,14 +10,19 @@ public class GUINandGate extends SimpleRectangularGUIGate { public GUINandGate(ViewModelModifiable model, int logicWidth) { - super(model, logicWidth, "&", true); + this(model, logicWidth, null); + } + + public GUINandGate(ViewModelModifiable model, int logicWidth, String name) + { + super(model, "&", true, logicWidth, name); setInputCount(2);// TODO make variable } static { ViewLogicModelAdapter.addComponentAdapter(new SimpleGateAdapter<>(GUINandGate.class, NandGate::new)); - // TODO read params - IndirectGUIComponentCreator.setComponentProvider(GUINandGate.class.getCanonicalName(), (m, p) -> new GUINandGate(m, 1)); + IndirectGUIComponentCreator.setComponentSupplier(GUINandGate.class.getCanonicalName(), + (m, p, n) -> new GUINandGate(m, p.getAsInt(), n)); } } \ No newline at end of file