GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUIsel3_4.java
index dd342c9..5695df8 100644 (file)
@@ -2,17 +2,23 @@ package net.mograsim.logic.ui.model.components.mi.nandbased;
 
 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.mograsim.logic.ui.model.ViewModelModifiable;
-import net.mograsim.logic.ui.model.components.GUINandGate;
-import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent;
+import net.mograsim.logic.ui.model.components.atomic.GUINandGate;
+import net.mograsim.logic.ui.model.components.submodels.SimpleRectangularSubmodelComponent;
 import net.mograsim.logic.ui.model.wires.GUIWire;
 import net.mograsim.logic.ui.model.wires.Pin;
 import net.mograsim.logic.ui.model.wires.WireCrossPoint;
+import net.mograsim.logic.ui.serializing.IndirectGUIComponentCreator;
 
 public class GUIsel3_4 extends SimpleRectangularSubmodelComponent
 {
        public GUIsel3_4(ViewModelModifiable model)
        {
-               super(model, 1, "GUIsel3_4");
+               this(model, null);
+       }
+
+       public GUIsel3_4(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUIsel3_4", name);
                setSubmodelScale(.2);
                setInputPins("SA", "SB", "SC", "A1", "A2", "A3", "A4", "B1", "B2", "B3", "B4", "C1", "C2", "C3", "C4");
                setOutputPins("Y1", "Y2", "Y3", "Y4");
@@ -109,4 +115,9 @@ public class GUIsel3_4 extends SimpleRectangularSubmodelComponent
                new GUIWire(submodelModifiable, nandY3.getPin("Y"), Y3, new Point[0]);
                new GUIWire(submodelModifiable, nandY4.getPin("Y"), Y4, new Point[0]);
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUIsel3_4.class.getCanonicalName(), (m, p, n) -> new GUIsel3_4(m, n));
+       }
 }
\ No newline at end of file