X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fexamples%2FJsonExample.java;h=9596a6934cd2b2de2be3ff199dcfcca12f834e7b;hb=19ee1a7fdb06a1df65cd7df78fed935124496707;hp=793f0f7f45bd28da1d54404271f8468189880e97;hpb=20aa3391efe7ae7d99861741f8b5594f88eae1d9;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/examples/JsonExample.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/examples/JsonExample.java index 793f0f7f..9596a693 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/examples/JsonExample.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/examples/JsonExample.java @@ -27,7 +27,7 @@ public class JsonExample { super(model, 1, "Test"); setSubmodelScale(.4); - setInputPins("Test input pin"); + setInputPins("Input pin #0"); GUICustomComponentCreator.create(submodelModifiable, "HalfAdder.json"); } } @@ -92,12 +92,12 @@ public class JsonExample GUIBitDisplay bdZ = new GUIBitDisplay(model); bdZ.moveTo(90, 30); - new GUIWire(model, swA.getOutputPin(), adder.getInputPins().get(0)); - new GUIWire(model, swB.getOutputPin(), adder.getInputPins().get(1)); - new GUIWire(model, swC.getOutputPin(), adder.getInputPins().get(2)); + new GUIWire(model, swA.getOutputPin(), adder.getPin("A")); + new GUIWire(model, swB.getOutputPin(), adder.getPin("B")); + new GUIWire(model, swC.getOutputPin(), adder.getPin("C")); - new GUIWire(model, adder.getOutputPins().get(0), bdY.getInputPin()); - new GUIWire(model, adder.getOutputPins().get(1), bdZ.getInputPin()); + new GUIWire(model, adder.getPin("Y"), bdY.getInputPin()); + new GUIWire(model, adder.getPin("Z"), bdZ.getInputPin()); SubmodelComponent adder2 = GUICustomComponentCreator.create(model, pC, ""); @@ -114,11 +114,11 @@ public class JsonExample bdZ = new GUIBitDisplay(model); bdZ.moveTo(90, 85); - new GUIWire(model, swA.getOutputPin(), adder2.getPins().get(0)); - new GUIWire(model, swB.getOutputPin(), adder2.getPins().get(1)); - new GUIWire(model, swC.getOutputPin(), adder2.getPins().get(2)); + new GUIWire(model, swA.getOutputPin(), adder.getPin("A")); + new GUIWire(model, swB.getOutputPin(), adder.getPin("B")); + new GUIWire(model, swC.getOutputPin(), adder.getPin("C")); - new GUIWire(model, adder2.getPins().get(3), bdY.getInputPin()); - new GUIWire(model, adder2.getPins().get(4), bdZ.getInputPin()); + new GUIWire(model, adder.getPin("Y"), bdY.getInputPin()); + new GUIWire(model, adder.getPin("Z"), bdZ.getInputPin()); } } \ No newline at end of file