GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUIxor.java
index dcf6c1f..2fb100b 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 GUIxor extends SimpleRectangularSubmodelComponent
 {
        public GUIxor(ViewModelModifiable model)
        {
-               super(model, 1, "GUIxor");
+               this(model, null);
+       }
+
+       public GUIxor(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUIxor", name);
                setSubmodelScale(.4);
                setInputPins("A", "B");
                setOutputPins("Y");
@@ -56,4 +62,9 @@ public class GUIxor extends SimpleRectangularSubmodelComponent
                new GUIWire(submodelModifiable, nandYB.getPin("Y"), nandY.getPin("B"));
                new GUIWire(submodelModifiable, nandY.getPin("Y"), Y);
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUIxor.class.getCanonicalName(), (m, p, n) -> new GUIxor(m, n));
+       }
 }
\ No newline at end of file