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");
18 initSubmodelComponents();
21 @SuppressWarnings("unused") // for GUIWires being created
22 private void initSubmodelComponents()
24 Pin A1 = getInputSubmodelPins().get(0);
25 Pin A2 = getInputSubmodelPins().get(1);
26 Pin A3 = getInputSubmodelPins().get(2);
27 Pin A4 = getInputSubmodelPins().get(3);
28 Pin B = getInputSubmodelPins().get(4);
29 Pin Y1 = getOutputSubmodelPins().get(0);
30 Pin Y2 = getOutputSubmodelPins().get(1);
31 Pin Y3 = getOutputSubmodelPins().get(2);
32 Pin Y4 = getOutputSubmodelPins().get(3);
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.getInputPins().get(0), new Point[0]);
52 new GUIWire(submodelModifiable, A2, and2.getInputPins().get(0), new Point[0]);
53 new GUIWire(submodelModifiable, A3, and3.getInputPins().get(0), new Point[0]);
54 new GUIWire(submodelModifiable, A4, and4.getInputPins().get(0), new Point[0]);
55 new GUIWire(submodelModifiable, B, cpB4, new Point(25, 112.5));
56 new GUIWire(submodelModifiable, cpB4, and4.getInputPins().get(1), new Point[0]);
57 new GUIWire(submodelModifiable, cpB4, cpB3, new Point[0]);
58 new GUIWire(submodelModifiable, cpB3, and3.getInputPins().get(1), new Point[0]);
59 new GUIWire(submodelModifiable, cpB3, cpB2, new Point[0]);
60 new GUIWire(submodelModifiable, cpB2, and2.getInputPins().get(1), new Point[0]);
61 new GUIWire(submodelModifiable, cpB2, and1.getInputPins().get(1), new Point(25, 22.5));
62 new GUIWire(submodelModifiable, and1.getOutputPins().get(0), Y1, new Point[0]);
63 new GUIWire(submodelModifiable, and2.getOutputPins().get(0), Y2, new Point[0]);
64 new GUIWire(submodelModifiable, and3.getOutputPins().get(0), Y3, new Point[0]);
65 new GUIWire(submodelModifiable, and4.getOutputPins().get(0), Y4, new Point[0]);