GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUImux1.java
index dc9ea53..0e6eca6 100644 (file)
@@ -7,12 +7,18 @@ import net.mograsim.logic.ui.model.components.submodels.SimpleRectangularSubmode
 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 extends SimpleRectangularSubmodelComponent
 {
        public GUImux1(ViewModelModifiable model)
        {
-               super(model, 1, "GUImux1");
+               this(model, null);
+       }
+
+       public GUImux1(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUImux1", name);
                setSubmodelScale(.4);
                setInputPins("S0", "I0", "I1");
                setOutputPins("Y");
@@ -54,4 +60,9 @@ public class GUImux1 extends SimpleRectangularSubmodelComponent
                new GUIWire(submodelModifiable, nandI1.getPin("Y"), nandY.getPin("B"));
                new GUIWire(submodelModifiable, nandY.getPin("Y"), Y);
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUImux1.class.getCanonicalName(), (m, p, n) -> new GUImux1(m, n));
+       }
 }
\ No newline at end of file