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.SubmodelComponent;
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 SubmodelComponent
12 private final Pin pinA1;
13 private final Pin pinA2;
14 private final Pin pinA3;
15 private final Pin pinA4;
16 private final Pin pinB;
17 private final Pin pinY1;
18 private final Pin pinY2;
19 private final Pin pinY3;
20 private final Pin pinY4;
22 public GUIand41(ViewModelModifiable model)
24 super(model, "GUIand41");
28 Pin A1 = addSubmodelInterface(1, 0, 5);
29 Pin A2 = addSubmodelInterface(1, 0, 15);
30 Pin A3 = addSubmodelInterface(1, 0, 25);
31 Pin A4 = addSubmodelInterface(1, 0, 35);
32 Pin B = addSubmodelInterface(1, 0, 50);
33 Pin Y1 = addSubmodelInterface(1, 35, 5);
34 Pin Y2 = addSubmodelInterface(1, 35, 15);
35 Pin Y3 = addSubmodelInterface(1, 35, 25);
36 Pin Y4 = addSubmodelInterface(1, 35, 35);
38 this.pinA1 = getSupermodelPin(A1);
39 this.pinA2 = getSupermodelPin(A2);
40 this.pinA3 = getSupermodelPin(A3);
41 this.pinA4 = getSupermodelPin(A4);
42 this.pinB = getSupermodelPin(B);
43 this.pinY1 = getSupermodelPin(Y1);
44 this.pinY2 = getSupermodelPin(Y2);
45 this.pinY3 = getSupermodelPin(Y3);
46 this.pinY4 = getSupermodelPin(Y4);
48 initSubmodelComponents(A1, A2, A3, A4, B, Y1, Y2, Y3, Y4);
51 @SuppressWarnings("unused") // for GUIWires being created
52 private void initSubmodelComponents(Pin A1, Pin A2, Pin A3, Pin A4, Pin B, Pin Y1, Pin Y2, Pin Y3, Pin Y4)
54 GUIand and1 = new GUIand(submodelModifiable);
55 GUIand and2 = new GUIand(submodelModifiable);
56 GUIand and3 = new GUIand(submodelModifiable);
57 GUIand and4 = new GUIand(submodelModifiable);
59 WireCrossPoint cpB2 = new WireCrossPoint(submodelModifiable, 1);
60 WireCrossPoint cpB3 = new WireCrossPoint(submodelModifiable, 1);
61 WireCrossPoint cpB4 = new WireCrossPoint(submodelModifiable, 1);
64 and2.moveTo(30, 32.5);
65 and3.moveTo(30, 57.5);
66 and4.moveTo(30, 82.5);
67 cpB2.moveTo(25, 52.5);
68 cpB3.moveTo(25, 77.5);
69 cpB4.moveTo(25, 102.5);
71 new GUIWire(submodelModifiable, A1, and1.getPinA());
72 new GUIWire(submodelModifiable, A2, and2.getPinA());
73 new GUIWire(submodelModifiable, A3, and3.getPinA());
74 new GUIWire(submodelModifiable, A4, and4.getPinA());
75 new GUIWire(submodelModifiable, B, cpB4, new Point(25, 125));
76 new GUIWire(submodelModifiable, cpB4, and4.getPinB());
77 new GUIWire(submodelModifiable, cpB4, cpB3);
78 new GUIWire(submodelModifiable, cpB3, and3.getPinB());
79 new GUIWire(submodelModifiable, cpB3, cpB2);
80 new GUIWire(submodelModifiable, cpB2, and2.getPinB());
81 new GUIWire(submodelModifiable, cpB2, and1.getPinB(), new Point(25, 27.5));
82 new GUIWire(submodelModifiable, and1.getPinY(), Y1, new Point(75, 20), new Point(75, 12.5));
83 new GUIWire(submodelModifiable, and2.getPinY(), Y2, new Point(75, 45), new Point(75, 37.5));
84 new GUIWire(submodelModifiable, and3.getPinY(), Y3, new Point(75, 70), new Point(75, 62.5));
85 new GUIWire(submodelModifiable, and4.getPinY(), Y4, new Point(75, 95), new Point(75, 87.5));
103 public Pin getPinA4()
113 public Pin getPinY1()
118 public Pin getPinY2()
123 public Pin getPinY3()
128 public Pin getPinY4()