GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / am2901 / GUIAm2901ALUOneBit.java
index 4db026f..ffe8b95 100644 (file)
@@ -11,12 +11,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 GUIAm2901ALUOneBit extends SimpleRectangularSubmodelComponent
 {
        public GUIAm2901ALUOneBit(ViewModelModifiable model)
        {
-               super(model, 1, "GUIAm2901ALUOneBit");
+               this(model, null);
+       }
+
+       public GUIAm2901ALUOneBit(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUIAm2901ALUOneBit", name);
                setSubmodelScale(.2);
                setInputPins("Cin", "CoutE", "CinE", "R", "RN", "S", "SN", "FN", "L");
                setOutputPins("Cout", "F");
@@ -86,4 +92,10 @@ public class GUIAm2901ALUOneBit extends SimpleRectangularSubmodelComponent
                new GUIWire(submodelModifiable, Coutand.getPin("Y"), Cout, new Point[0]);
                new GUIWire(submodelModifiable, Fxor.getPin("Y"), F, new Point[0]);
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUIAm2901ALUOneBit.class.getCanonicalName(),
+                               (m, p, n) -> new GUIAm2901ALUOneBit(m, n));
+       }
 }
\ No newline at end of file