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 GUImux1 extends SimpleRectangularSubmodelComponent
13 public GUImux1(ViewModelModifiable model)
15 super(model, 1, "GUImux1");
20 initSubmodelComponents();
23 @SuppressWarnings("unused")
24 private void initSubmodelComponents()
26 Pin S0 = getInputSubmodelPins().get(0);
27 Pin I0 = getInputSubmodelPins().get(1);
28 Pin I1 = getInputSubmodelPins().get(2);
29 Pin Y = getOutputSubmodelPins().get(0);
31 GUINandGate nandS0 = new GUINandGate(submodelModifiable, 1);
32 GUINandGate nandI0 = new GUINandGate(submodelModifiable, 1);
33 GUINandGate nandI1 = new GUINandGate(submodelModifiable, 1);
34 GUINandGate nandY = new GUINandGate(submodelModifiable, 1);
36 nandS0.moveTo(10, 7.5);
37 nandI0.moveTo(35, 22.5);
38 nandI1.moveTo(35, 47.5);
41 WireCrossPoint cp0 = new WireCrossPoint(submodelModifiable, 1);
42 WireCrossPoint cp1 = new WireCrossPoint(submodelModifiable, 1);
47 new GUIWire(submodelModifiable, S0, cp0, new Point[0]);
48 new GUIWire(submodelModifiable, cp0, nandS0.getInputPins().get(0), new Point[0]);
49 new GUIWire(submodelModifiable, cp0, cp1, new Point[0]);
50 new GUIWire(submodelModifiable, cp1, nandS0.getInputPins().get(1), new Point[0]);
52 new GUIWire(submodelModifiable, nandS0.getOutputPin(), nandI0.getInputPins().get(0));
53 new GUIWire(submodelModifiable, I0, nandI0.getInputPins().get(1), new Point[0]);
55 new GUIWire(submodelModifiable, cp1, nandI1.getInputPins().get(0),
56 new Point(cp1.getPin().getPos().x, nandI1.getInputPins().get(0).getPos().y));
57 new GUIWire(submodelModifiable, I1, nandI1.getInputPins().get(1), new Point[0]);
59 new GUIWire(submodelModifiable, nandI0.getOutputPin(), nandY.getInputPins().get(0));
60 new GUIWire(submodelModifiable, nandI1.getOutputPin(), nandY.getInputPins().get(1));
62 new GUIWire(submodelModifiable, nandY.getOutputPin(), Y);