GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUIram4.java
index 333dc07..38b7516 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 GUIram4 extends SimpleRectangularSubmodelComponent
 {
        public GUIram4(ViewModelModifiable model)
        {
-               super(model, 1, "GUIram4");
+               this(model, null);
+       }
+
+       public GUIram4(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUIram4", name);
                setSubmodelScale(.1);
                setInputPins("A0", "A1", "A2", "A3", "B0", "B1", "B2", "B3", "WE", "D1", "D2", "D3", "D4");
                setOutputPins("QA1", "QA2", "QA3", "QA4", "QB1", "QB2", "QB3", "QB4");
@@ -357,4 +363,9 @@ public class GUIram4 extends SimpleRectangularSubmodelComponent
                return (addr3 == '0' || addr3 == '1') || (addr2 == '0' || addr2 == '1') || (addr1 == '0' || addr1 == '1')
                                || (addr0 == '0' || addr0 == '1');
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUIram4.class.getCanonicalName(), (m, p, n) -> new GUIram4(m, n));
+       }
 }
\ No newline at end of file