GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUInot4.java
index 7fb2b5b..b1e9985 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 GUInot4 extends SimpleRectangularSubmodelComponent
 {
        public GUInot4(ViewModelModifiable model)
        {
-               super(model, 1, "GUInot4");
+               this(model, null);
+       }
+
+       public GUInot4(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUInot4", name);
                setSubmodelScale(.4);
                setInputPins("A1", "A2", "A3", "A4");
                setOutputPins("Y1", "Y2", "Y3", "Y4");
@@ -67,4 +73,9 @@ public class GUInot4 extends SimpleRectangularSubmodelComponent
                new GUIWire(submodelModifiable, nand3.getPin("Y"), Y3, new Point[0]);
                new GUIWire(submodelModifiable, nand4.getPin("Y"), Y4, new Point[0]);
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUInot4.class.getCanonicalName(), (m, p, n) -> new GUInot4(m, n));
+       }
 }
\ No newline at end of file