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;
9 public class GUIandor414 extends SubmodelComponent
11 private final Pin pinC1;
12 private final Pin pinC2;
13 private final Pin pinC3;
14 private final Pin pinC4;
15 private final Pin pinA1;
16 private final Pin pinA2;
17 private final Pin pinA3;
18 private final Pin pinA4;
19 private final Pin pinB;
20 private final Pin pinY1;
21 private final Pin pinY2;
22 private final Pin pinY3;
23 private final Pin pinY4;
25 public GUIandor414(ViewModelModifiable model)
27 super(model, "GUIandor414");
31 Pin C1 = addSubmodelInterface(1, 0, 5);
32 Pin C2 = addSubmodelInterface(1, 0, 15);
33 Pin C3 = addSubmodelInterface(1, 0, 25);
34 Pin C4 = addSubmodelInterface(1, 0, 35);
35 Pin A1 = addSubmodelInterface(1, 0, 45);
36 Pin A2 = addSubmodelInterface(1, 0, 55);
37 Pin A3 = addSubmodelInterface(1, 0, 65);
38 Pin A4 = addSubmodelInterface(1, 0, 75);
39 Pin B = addSubmodelInterface(1, 0, 85);
40 Pin Y1 = addSubmodelInterface(1, 50, 5);
41 Pin Y2 = addSubmodelInterface(1, 50, 15);
42 Pin Y3 = addSubmodelInterface(1, 50, 25);
43 Pin Y4 = addSubmodelInterface(1, 50, 35);
45 this.pinC1 = getSupermodelPin(C1);
46 this.pinC2 = getSupermodelPin(C2);
47 this.pinC3 = getSupermodelPin(C3);
48 this.pinC4 = getSupermodelPin(C4);
49 this.pinA1 = getSupermodelPin(A1);
50 this.pinA2 = getSupermodelPin(A2);
51 this.pinA3 = getSupermodelPin(A3);
52 this.pinA4 = getSupermodelPin(A4);
53 this.pinB = getSupermodelPin(B);
54 this.pinY1 = getSupermodelPin(Y1);
55 this.pinY2 = getSupermodelPin(Y2);
56 this.pinY3 = getSupermodelPin(Y3);
57 this.pinY4 = getSupermodelPin(Y4);
59 initSubmodelComponents(C1, C2, C3, C4, A1, A2, A3, A4, B, Y1, Y2, Y3, Y4);
62 @SuppressWarnings("unused") // for GUIWires being created
63 private void initSubmodelComponents(Pin C1, Pin C2, Pin C3, Pin C4, Pin A1, Pin A2, Pin A3, Pin A4, Pin B, Pin Y1, Pin Y2, Pin Y3,
66 GUIand41 and = new GUIand41(submodelModifiable);
67 GUIor_4 or = new GUIor_4(submodelModifiable);
69 and.moveTo(15, 137.5);
72 new GUIWire(submodelModifiable, A1, and.getPinA1(), new Point(10, 112.5), new Point(10, 142.5));
73 new GUIWire(submodelModifiable, A2, and.getPinA2(), new Point(5, 137.5), new Point(5, 152.5));
74 new GUIWire(submodelModifiable, A3, and.getPinA3());
75 new GUIWire(submodelModifiable, A4, and.getPinA4(), new Point(5, 187.5), new Point(5, 172.5));
76 new GUIWire(submodelModifiable, B, and.getPinB(), new Point(10, 212.5), new Point(10, 187.5));
77 new GUIWire(submodelModifiable, C1, or.getPinA1(), new Point(50, 12.5), new Point(50, 102.5));
78 new GUIWire(submodelModifiable, C2, or.getPinA2(), new Point(45, 37.5), new Point(45, 112.5));
79 new GUIWire(submodelModifiable, C3, or.getPinA3(), new Point(40, 62.5), new Point(40, 122.5));
80 new GUIWire(submodelModifiable, C4, or.getPinA4(), new Point(35, 87.5), new Point(35, 132.5));
81 new GUIWire(submodelModifiable, and.getPinY1(), or.getPinB1());
82 new GUIWire(submodelModifiable, and.getPinY2(), or.getPinB2());
83 new GUIWire(submodelModifiable, and.getPinY3(), or.getPinB3());
84 new GUIWire(submodelModifiable, and.getPinY4(), or.getPinB4());
85 new GUIWire(submodelModifiable, or.getPinY1(), Y1, new Point(100, 102.5), new Point(100, 12.5));
86 new GUIWire(submodelModifiable, or.getPinY2(), Y2, new Point(105, 112.5), new Point(105, 37.5));
87 new GUIWire(submodelModifiable, or.getPinY3(), Y3, new Point(110, 122.5), new Point(110, 62.5));
88 new GUIWire(submodelModifiable, or.getPinY4(), Y4, new Point(115, 132.5), new Point(115, 87.5));
101 public Pin getPinC3()
106 public Pin getPinC4()
111 public Pin getPinA1()
116 public Pin getPinA2()
121 public Pin getPinA3()
126 public Pin getPinA4()
136 public Pin getPinY1()
141 public Pin getPinY2()
146 public Pin getPinY3()
151 public Pin getPinY4()