1 package net.mograsim.logic.ui.examples;
3 import net.mograsim.logic.ui.SimpleLogicUIStandalone;
4 import net.mograsim.logic.ui.model.ViewModelModifiable;
5 import net.mograsim.logic.ui.model.components.GUIBitDisplay;
6 import net.mograsim.logic.ui.model.components.GUIManualSwitch;
7 import net.mograsim.logic.ui.model.components.TestSubmodelNANDComponent;
8 import net.mograsim.logic.ui.model.wires.GUIWire;
10 public class SubmodelExample
12 public static void main(String[] args)
14 SimpleLogicUIStandalone.executeVisualisation(SubmodelExample::createSubmodelExample);
17 @SuppressWarnings("unused") // GUIWires being created
18 public static void createSubmodelExample(ViewModelModifiable model)
20 GUIManualSwitch swA = new GUIManualSwitch(model);
22 GUIManualSwitch swB = new GUIManualSwitch(model);
24 TestSubmodelNANDComponent nand = new TestSubmodelNANDComponent(model);
26 GUIBitDisplay bdY = new GUIBitDisplay(model);
29 new GUIWire(model, swA.getOutputPin(), nand.getPins().get(0));
30 new GUIWire(model, swB.getOutputPin(), nand.getPins().get(1));
31 new GUIWire(model, nand.getPins().get(2), bdY.getInputPin());