X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2Fmi%2Fnandbased%2FGUIand.java;h=2d6d3b5fcda94ad7d92d6bdad325dad36f8958fe;hb=5fd86d84a38b322a67f454998f7f1a0e424c90b4;hp=9cec0cecd2d9705fa3571687fef508a879c35845;hpb=20e9d3d11e5d06c45834c303e48522cbc4bfa98f;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIand.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIand.java index 9cec0cec..2d6d3b5f 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIand.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIand.java @@ -10,21 +10,30 @@ import net.mograsim.logic.ui.model.wires.WireCrossPoint; public class GUIand extends SubmodelComponent { + private final Pin pinA; + private final Pin pinB; + private final Pin pinY; + public GUIand(ViewModelModifiable model) { super(model, "GUIand"); setSize(35, 25); setSubmodelScale(.4); - initSubmodelComponents(); - } - @SuppressWarnings("unused") // for GUIWires being created - private void initSubmodelComponents() - { Pin A = addSubmodelInterface(1, 0, 5); Pin B = addSubmodelInterface(1, 0, 20); Pin Y = addSubmodelInterface(1, 35, 12.5); + this.pinA = getSupermodelPin(A); + this.pinB = getSupermodelPin(B); + this.pinY = getSupermodelPin(Y); + + initSubmodelComponents(A, B, Y); + } + + @SuppressWarnings("unused") // for GUIWires being created + private void initSubmodelComponents(Pin A, Pin B, Pin Y) + { GUINandGate nand = new GUINandGate(submodelModifiable, 1); nand.moveTo(20, 21.25); GUINandGate not = new GUINandGate(submodelModifiable, 1); @@ -40,4 +49,20 @@ public class GUIand extends SubmodelComponent new GUIWire(submodelModifiable, cp1.getPin(), not.getInputPins().get(1), new Point(45, 36.25)); new GUIWire(submodelModifiable, not.getOutputPin(), Y); } + + public Pin getPinA() + { + return pinA; + } + + public Pin getPinB() + { + return pinB; + } + + public Pin getPinY() + { + return pinY; + } + } \ No newline at end of file