1 package net.mograsim.logic.ui.model.components.mi.nandbased;
3 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
4 import net.mograsim.logic.ui.model.ViewModelModifiable;
5 import net.mograsim.logic.ui.model.components.GUINandGate;
6 import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent;
7 import net.mograsim.logic.ui.model.wires.GUIWire;
8 import net.mograsim.logic.ui.model.wires.Pin;
9 import net.mograsim.logic.ui.model.wires.WireCrossPoint;
11 public class GUIand extends SimpleRectangularSubmodelComponent
13 public GUIand(ViewModelModifiable model)
15 super(model, 1, "GUIand");
17 setInputPins("A", "B");
19 initSubmodelComponents();
22 @SuppressWarnings("unused") // for GUIWires being created
23 private void initSubmodelComponents()
25 Pin A = getSubmodelPin("A");
26 Pin B = getSubmodelPin("B");
27 Pin Y = getSubmodelPin("Y");
29 GUINandGate nand = new GUINandGate(submodelModifiable, 1);
30 GUINandGate not = new GUINandGate(submodelModifiable, 1);
32 WireCrossPoint cp1 = new WireCrossPoint(submodelModifiable, 1);
36 cp1.moveCenterTo(45, 25);
38 new GUIWire(submodelModifiable, A, nand.getPin("A"));
39 new GUIWire(submodelModifiable, B, nand.getPin("B"));
40 new GUIWire(submodelModifiable, nand.getPin("Y"), cp1, new Point[0]);
41 new GUIWire(submodelModifiable, cp1, not.getPin("A"), new Point(45, 20));
42 new GUIWire(submodelModifiable, cp1, not.getPin("B"), new Point(45, 30));
43 new GUIWire(submodelModifiable, not.getPin("Y"), Y);