X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui.am2900%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fexamples%2FJsonExample.java;h=a35ab2fb90c6fc58bf9380ee4dc56ec451ea7a18;hb=c2ba1e811b4ebd9e14377e25fadaf5774a28830e;hp=4ebd32ae3cb17bb3ba7ad72b958495f49c415c8e;hpb=b37ba7609a925cc945bbac0f6ead619d07912238;p=Mograsim.git diff --git a/net.mograsim.logic.ui.am2900/src/net/mograsim/logic/ui/examples/JsonExample.java b/net.mograsim.logic.ui.am2900/src/net/mograsim/logic/ui/examples/JsonExample.java index 4ebd32ae..a35ab2fb 100644 --- a/net.mograsim.logic.ui.am2900/src/net/mograsim/logic/ui/examples/JsonExample.java +++ b/net.mograsim.logic.ui.am2900/src/net/mograsim/logic/ui/examples/JsonExample.java @@ -1,10 +1,12 @@ package net.mograsim.logic.ui.examples; import java.io.IOException; +import java.util.HashMap; import net.mograsim.logic.ui.SimpleLogicUIStandalone; import net.mograsim.logic.ui.model.ViewModelModifiable; import net.mograsim.logic.ui.model.components.GUIBitDisplay; +import net.mograsim.logic.ui.model.components.GUIComponentCreator; import net.mograsim.logic.ui.model.components.GUICustomComponentCreator; import net.mograsim.logic.ui.model.components.GUIManualSwitch; import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent; @@ -18,7 +20,12 @@ public class JsonExample { public static void main(String[] args) { - SimpleLogicUIStandalone.executeVisualisation(JsonExample::refJsonFromJsonTest); + SimpleLogicUIStandalone.executeVisualisation(JsonExample::mappingTest); + } + + public static void mappingTest(ViewModelModifiable model) + { + GUIComponentCreator.create(model, "GUIAm2901", new HashMap()); } private static class TestComponent extends SimpleRectangularSubmodelComponent @@ -39,7 +46,6 @@ public class JsonExample t.calculateParams().writeJson("Test.json"); SubmodelComponent c = GUICustomComponentCreator.create(model, "Test.json"); c.moveTo(0, 50); - } public static void createHalfAdderExample(ViewModelModifiable model) @@ -57,7 +63,7 @@ public class JsonExample e.printStackTrace(); } - GUICustomComponentCreator.create(model, p, ""); + GUICustomComponentCreator.create(model, p); } @SuppressWarnings("unused") // for GUIWires being created @@ -99,7 +105,7 @@ public class JsonExample new GUIWire(model, adder.getPin("Y"), bdY.getInputPin()); new GUIWire(model, adder.getPin("Z"), bdZ.getInputPin()); - SubmodelComponent adder2 = GUICustomComponentCreator.create(model, pC, ""); + SubmodelComponent adder2 = GUICustomComponentCreator.create(model, pC); swA = new GUIManualSwitch(model); swA.moveTo(0, 70);