GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUI_rsLatch.java
index 1ee2a1e..4ae8bd3 100644 (file)
@@ -4,11 +4,12 @@ import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
 import net.mograsim.logic.core.types.Bit;
 import net.mograsim.logic.core.types.BitVector;
 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 GUI_rsLatch extends SimpleRectangularSubmodelComponent
 {
@@ -16,7 +17,12 @@ public class GUI_rsLatch extends SimpleRectangularSubmodelComponent
 
        public GUI_rsLatch(ViewModelModifiable model)
        {
-               super(model, 1, "_rsLatch");
+               this(model, null);
+       }
+
+       public GUI_rsLatch(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "_rsLatch", name);
                setSubmodelScale(.4);
                setInputPins("_S", "_R");
                setOutputPins("Q", "_Q");
@@ -95,4 +101,9 @@ public class GUI_rsLatch extends SimpleRectangularSubmodelComponent
                        throw new IllegalStateException("Illegal atomic state ID: " + stateID);
                }
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUI_rsLatch.class.getCanonicalName(), (m, p, n) -> new GUI_rsLatch(m, n));
+       }
 }
\ No newline at end of file