GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / am2901 / GUIAm2901QReg.java
index 11a7241..f45c116 100644 (file)
@@ -10,6 +10,7 @@ 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 GUIAm2901QReg extends SimpleRectangularSubmodelComponent
 {
@@ -20,7 +21,12 @@ public class GUIAm2901QReg extends SimpleRectangularSubmodelComponent
 
        public GUIAm2901QReg(ViewModelModifiable model)
        {
-               super(model, 1, "GUIAm2901QReg");
+               this(model, null);
+       }
+
+       public GUIAm2901QReg(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUIAm2901QReg", name);
                setSubmodelScale(.4);
                setInputPins("C", "WE", "D1", "D2", "D3", "D4");
                setOutputPins("Q1", "Q2", "Q3", "Q4");
@@ -140,4 +146,9 @@ public class GUIAm2901QReg extends SimpleRectangularSubmodelComponent
                        throw new IllegalStateException("Illegal atomic state ID: " + stateID);
                }
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUIAm2901QReg.class.getCanonicalName(), (m, p, n) -> new GUIAm2901QReg(m, n));
+       }
 }
\ No newline at end of file