GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUImux1.java
index 9707e21..0e6eca6 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 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