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.SimpleRectangularSubmodelComponent;
6 import net.mograsim.logic.ui.model.wires.GUIWire;
7 import net.mograsim.logic.ui.model.wires.Pin;
8 import net.mograsim.logic.ui.model.wires.WireCrossPoint;
10 public class GUIand41 extends SimpleRectangularSubmodelComponent
12 public GUIand41(ViewModelModifiable model)
14 super(model, 1, "GUIand41");
16 setInputPins("A1", "A2", "A3", "A4", "B");
17 setOutputPins("Y1", "Y2", "Y3", "Y4");
18 initSubmodelComponents();
21 @SuppressWarnings("unused") // for GUIWires being created
22 private void initSubmodelComponents()
24 Pin A1 = getSubmodelPin("A1");
25 Pin A2 = getSubmodelPin("A2");
26 Pin A3 = getSubmodelPin("A3");
27 Pin A4 = getSubmodelPin("A4");
28 Pin B = getSubmodelPin("B");
29 Pin Y1 = getSubmodelPin("Y1");
30 Pin Y2 = getSubmodelPin("Y2");
31 Pin Y3 = getSubmodelPin("Y3");
32 Pin Y4 = getSubmodelPin("Y4");
34 GUIand and1 = new GUIand(submodelModifiable);
35 GUIand and2 = new GUIand(submodelModifiable);
36 GUIand and3 = new GUIand(submodelModifiable);
37 GUIand and4 = new GUIand(submodelModifiable);
39 WireCrossPoint cpB2 = new WireCrossPoint(submodelModifiable, 1);
40 WireCrossPoint cpB3 = new WireCrossPoint(submodelModifiable, 1);
41 WireCrossPoint cpB4 = new WireCrossPoint(submodelModifiable, 1);
44 and2.moveTo(30, 32.5);
45 and3.moveTo(30, 57.5);
46 and4.moveTo(30, 82.5);
47 cpB2.moveCenterTo(25, 47.5);
48 cpB3.moveCenterTo(25, 72.5);
49 cpB4.moveCenterTo(25, 97.5);
51 new GUIWire(submodelModifiable, A1, and1.getPin("A"), new Point[0]);
52 new GUIWire(submodelModifiable, A2, and2.getPin("A"), new Point[0]);
53 new GUIWire(submodelModifiable, A3, and3.getPin("A"), new Point[0]);
54 new GUIWire(submodelModifiable, A4, and4.getPin("A"), new Point[0]);
55 new GUIWire(submodelModifiable, B, cpB4, new Point(25, 112.5));
56 new GUIWire(submodelModifiable, cpB4, and4.getPin("B"), new Point[0]);
57 new GUIWire(submodelModifiable, cpB4, cpB3, new Point[0]);
58 new GUIWire(submodelModifiable, cpB3, and3.getPin("B"), new Point[0]);
59 new GUIWire(submodelModifiable, cpB3, cpB2, new Point[0]);
60 new GUIWire(submodelModifiable, cpB2, and2.getPin("B"), new Point[0]);
61 new GUIWire(submodelModifiable, cpB2, and1.getPin("B"), new Point(25, 22.5));
62 new GUIWire(submodelModifiable, and1.getPin("Y"), Y1, new Point[0]);
63 new GUIWire(submodelModifiable, and2.getPin("Y"), Y2, new Point[0]);
64 new GUIWire(submodelModifiable, and3.getPin("Y"), Y3, new Point[0]);
65 new GUIWire(submodelModifiable, and4.getPin("Y"), Y4, new Point[0]);