1 package net.mograsim.logic.ui.model.components;
3 import net.mograsim.logic.ui.model.ViewModelModifiable;
4 import net.mograsim.logic.ui.model.wires.GUIWire;
5 import net.mograsim.logic.ui.model.wires.Pin;
7 public class TestSubmodelNANDComponent extends SubmodelComponent
9 public TestSubmodelNANDComponent(ViewModelModifiable model)
11 super(model, "TestNAND");
14 initSubmodelComponents();
17 @SuppressWarnings("unused") // GUIWires being created
18 private void initSubmodelComponents()
20 Pin A = addSubmodelInterface(1, 0, 5);
21 Pin B = addSubmodelInterface(1, 0, 15);
22 Pin Y = addSubmodelInterface(1, 30, 10);
24 GUIAndGate and = new GUIAndGate(submodelModifiable, 1);
26 GUINotGate not = new GUINotGate(submodelModifiable, 1);
29 new GUIWire(submodelModifiable, A, and.getInputPins().get(0));
30 new GUIWire(submodelModifiable, B, and.getInputPins().get(1));
31 new GUIWire(submodelModifiable, and.getOutputPin(), not.getInputPins().get(0));
32 new GUIWire(submodelModifiable, not.getOutputPin(), Y);