GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUIdlatch4.java
index 36a05af..388c454 100644 (file)
@@ -8,6 +8,7 @@ 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 GUIdlatch4 extends SimpleRectangularSubmodelComponent
 {
@@ -18,7 +19,12 @@ public class GUIdlatch4 extends SimpleRectangularSubmodelComponent
 
        public GUIdlatch4(ViewModelModifiable model)
        {
-               super(model, 1, "GUIdlatch4");
+               this(model, null);
+       }
+
+       public GUIdlatch4(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUIdlatch4", name);
                setSubmodelScale(.4);
                setInputPins("D1", "D2", "D3", "D4", "C");
                setOutputPins("Q1", "Q2", "Q3", "Q4");
@@ -132,4 +138,9 @@ public class GUIdlatch4 extends SimpleRectangularSubmodelComponent
                        throw new IllegalStateException("Illegal atomic state ID: " + stateID);
                }
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUIdlatch4.class.getCanonicalName(), (m, p, n) -> new GUIdlatch4(m, n));
+       }
 }
\ No newline at end of file