GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUIandor414.java
index cf5146b..3f9d09c 100644 (file)
@@ -2,15 +2,21 @@ 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.SimpleRectangularSubmodelComponent;
+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.serializing.IndirectGUIComponentCreator;
 
 public class GUIandor414 extends SimpleRectangularSubmodelComponent
 {
        public GUIandor414(ViewModelModifiable model)
        {
-               super(model, 1, "GUIandor414");
+               this(model, null);
+       }
+
+       public GUIandor414(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUIandor414", name);
                setSubmodelScale(.4);
                setInputPins("C1", "C2", "C3", "C4", "A1", "A2", "A3", "A4", "B");
                setOutputPins("Y1", "Y2", "Y3", "Y4");
@@ -62,4 +68,9 @@ public class GUIandor414 extends SimpleRectangularSubmodelComponent
                new GUIWire(submodelModifiable, or.getPin("Y3"), Y3, new Point[0]);
                new GUIWire(submodelModifiable, or.getPin("Y4"), Y4, new Point(80, 72.5), new Point(80, 87.5));
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUIandor414.class.getCanonicalName(), (m, p, n) -> new GUIandor414(m, n));
+       }
 }
\ No newline at end of file