GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / am2901 / GUIAm2901ALUFuncDecode.java
index 339b18a..07af76d 100644 (file)
@@ -9,12 +9,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 GUIAm2901ALUFuncDecode extends SimpleRectangularSubmodelComponent
 {
        public GUIAm2901ALUFuncDecode(ViewModelModifiable model)
        {
-               super(model, 1, "GUIAm2901ALUFuncDecode");
+               this(model, null);
+       }
+
+       public GUIAm2901ALUFuncDecode(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUIAm2901ALUFuncDecode", name);
                setSubmodelScale(.25);
                setInputPins("I5", "I4", "I3");
                setOutputPins("CinE", "L", "SN", "SBE", "FN", "RN");
@@ -106,4 +112,10 @@ public class GUIAm2901ALUFuncDecode extends SimpleRectangularSubmodelComponent
                new GUIWire(submodelModifiable, nandL.getPin("Y"), L, new Point[0]);
                new GUIWire(submodelModifiable, andSBE.getPin("Y"), SBE, new Point[0]);
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUIAm2901ALUFuncDecode.class.getCanonicalName(),
+                               (m, p, n) -> new GUIAm2901ALUFuncDecode(m, n));
+       }
 }
\ No newline at end of file