GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUInand3.java
index f102c3b..56076cf 100644 (file)
@@ -2,17 +2,23 @@ package net.mograsim.logic.ui.model.components.mi.nandbased;
 
 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.mograsim.logic.ui.model.ViewModelModifiable;
-import net.mograsim.logic.ui.model.components.GUINandGate;
-import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent;
+import net.mograsim.logic.ui.model.components.atomic.GUINandGate;
+import net.mograsim.logic.ui.model.components.submodels.SimpleRectangularSubmodelComponent;
 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 GUInand3 extends SimpleRectangularSubmodelComponent
 {
        public GUInand3(ViewModelModifiable model)
        {
-               super(model, 1, "GUInand3");
+               this(model, null);
+       }
+
+       public GUInand3(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUInand3", name);
                setSubmodelScale(.4);
                setInputPins("A", "B", "C");
                setOutputPins("Y");
@@ -47,4 +53,9 @@ public class GUInand3 extends SimpleRectangularSubmodelComponent
                new GUIWire(submodelModifiable, C, nandABC.getPin("B"), new Point(60, 62.5), new Point(60, 17.5));
                new GUIWire(submodelModifiable, nandABC.getPin("Y"), Y, new Point[0]);
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUInand3.class.getCanonicalName(), (m, p, n) -> new GUInand3(m, n));
+       }
 }
\ No newline at end of file