Pins are now accessed via name, not index
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUIfulladder.java
index 1f424a9..12bddce 100644 (file)
@@ -21,11 +21,11 @@ public class GUIfulladder extends SimpleRectangularSubmodelComponent
        @SuppressWarnings("unused") // for GUIWires being created
        private void initSubmodelComponents()
        {
-               Pin A = getInputSubmodelPins().get(0);
-               Pin B = getInputSubmodelPins().get(1);
-               Pin C = getInputSubmodelPins().get(2);
-               Pin Y = getOutputSubmodelPins().get(0);
-               Pin Z = getOutputSubmodelPins().get(1);
+               Pin A = getSubmodelPin("A");
+               Pin B = getSubmodelPin("B");
+               Pin C = getSubmodelPin("C");
+               Pin Y = getSubmodelPin("Y");
+               Pin Z = getSubmodelPin("Z");
 
                GUIhalfadder halfBC = new GUIhalfadder(submodelModifiable);
                GUIhalfadder halfAY = new GUIhalfadder(submodelModifiable);
@@ -35,14 +35,14 @@ public class GUIfulladder extends SimpleRectangularSubmodelComponent
                halfBC.moveTo(5, 40);
                nandZ.moveTo(57.5, 40);
 
-               new GUIWire(submodelModifiable, A, halfAY.getInputPins().get(0), new Point[0]);
-               new GUIWire(submodelModifiable, B, halfBC.getInputPins().get(0));
-               new GUIWire(submodelModifiable, C, halfBC.getInputPins().get(1));
-               new GUIWire(submodelModifiable, halfBC.getOutputPins().get(0), halfAY.getInputPins().get(1));
-               new GUIWire(submodelModifiable, halfBC.getOutputPins().get(1), nandZ.getInputPins().get(1), new Point[0]);
-               new GUIWire(submodelModifiable, halfAY.getOutputPins().get(0), Y, new Point[0]);
-               new GUIWire(submodelModifiable, halfAY.getOutputPins().get(1), nandZ.getInputPins().get(0), new Point(82.5, 22.5),
-                               new Point(82.5, 35), new Point(52.5, 35), new Point(52.5, 45));
-               new GUIWire(submodelModifiable, nandZ.getOutputPin(), Z);
+               new GUIWire(submodelModifiable, A, halfAY.getPin("A"), new Point[0]);
+               new GUIWire(submodelModifiable, B, halfBC.getPin("A"));
+               new GUIWire(submodelModifiable, C, halfBC.getPin("B"));
+               new GUIWire(submodelModifiable, halfBC.getPin("Y"), halfAY.getPin("B"));
+               new GUIWire(submodelModifiable, halfBC.getPin("_Z"), nandZ.getPin("B"), new Point[0]);
+               new GUIWire(submodelModifiable, halfAY.getPin("Y"), Y, new Point[0]);
+               new GUIWire(submodelModifiable, halfAY.getPin("_Z"), nandZ.getPin("A"), new Point(82.5, 22.5), new Point(82.5, 35),
+                               new Point(52.5, 35), new Point(52.5, 45));
+               new GUIWire(submodelModifiable, nandZ.getPin("Y"), Z);
        }
 }
\ No newline at end of file