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 GUInand3 extends SimpleRectangularSubmodelComponent
13 public GUInand3(ViewModelModifiable model)
15 super(model, 1, "GUInand3");
17 setInputPins("A", "B", "C");
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 C = getSubmodelPin("C");
28 Pin Y = getSubmodelPin("Y");
30 GUINandGate nandAB = new GUINandGate(submodelModifiable, 1);
31 GUINandGate andAB = new GUINandGate(submodelModifiable, 1);
32 GUINandGate nandABC = new GUINandGate(submodelModifiable, 1);
34 WireCrossPoint cpNandAB = new WireCrossPoint(submodelModifiable, 1);
36 nandAB.moveTo(10, 15);
38 nandABC.moveTo(62.5, 2.5);
39 cpNandAB.moveCenterTo(32.5, 25);
41 new GUIWire(submodelModifiable, A, nandAB.getPin("A"));
42 new GUIWire(submodelModifiable, B, nandAB.getPin("B"));
43 new GUIWire(submodelModifiable, nandAB.getPin("Y"), cpNandAB, new Point[0]);
44 new GUIWire(submodelModifiable, cpNandAB, andAB.getPin("A"), new Point(32.5, 20));
45 new GUIWire(submodelModifiable, cpNandAB, andAB.getPin("B"), new Point(32.5, 30));
46 new GUIWire(submodelModifiable, andAB.getPin("Y"), nandABC.getPin("A"), new Point(57.5, 25), new Point(57.5, 7.5));
47 new GUIWire(submodelModifiable, C, nandABC.getPin("B"), new Point(60, 62.5), new Point(60, 17.5));
48 new GUIWire(submodelModifiable, nandABC.getPin("Y"), Y, new Point[0]);