GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUImux1_4.java
index 479f66a..6fb74b3 100644 (file)
@@ -2,16 +2,22 @@ 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.SimpleRectangularSubmodelComponent;
+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 GUImux1_4 extends SimpleRectangularSubmodelComponent
 {
        public GUImux1_4(ViewModelModifiable model)
        {
-               super(model, 1, "GUImux1_4");
+               this(model, null);
+       }
+
+       public GUImux1_4(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUImux1_4", name);
                setSubmodelScale(.4);
                setInputPins("S0", "I0_1", "I0_2", "I0_3", "I0_4", "I1_1", "I1_2", "I1_3", "I1_4");
                setOutputPins("Y1", "Y2", "Y3", "Y4");
@@ -73,4 +79,9 @@ public class GUImux1_4 extends SimpleRectangularSubmodelComponent
                new GUIWire(submodelModifiable, mux4.getPin("Y"), Y4);
 
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUImux1_4.class.getCanonicalName(), (m, p, n) -> new GUImux1_4(m, n));
+       }
 }
\ No newline at end of file