GUIComponents now have names
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / am2901 / GUIAm2901ALUInclSourceDecodeInclFunctionDecode.java
index b5b6ec8..12da51c 100644 (file)
@@ -2,18 +2,24 @@ package net.mograsim.logic.ui.model.components.mi.nandbased.am2901;
 
 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.mi.nandbased.GUIsel2_4;
 import net.mograsim.logic.ui.model.components.mi.nandbased.GUIsel3_4;
+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 GUIAm2901ALUInclSourceDecodeInclFunctionDecode extends SimpleRectangularSubmodelComponent
 {
        public GUIAm2901ALUInclSourceDecodeInclFunctionDecode(ViewModelModifiable model)
        {
-               super(model, 1, "GUIAm2901ALUInclSourceDecodeInclFunctionDecode");
+               this(model, null);
+       }
+
+       public GUIAm2901ALUInclSourceDecodeInclFunctionDecode(ViewModelModifiable model, String name)
+       {
+               super(model, 1, "GUIAm2901ALUInclSourceDecodeInclFunctionDecode", name);
                setSubmodelScale(.25);
                setInputPins("I5", "I4", "I3", "I2", "I1", "I0", "Cn", "D1", "D2", "D3", "D4", "A1", "A2", "A3", "A4", "B1", "B2", "B3", "B4", "Q1",
                                "Q2", "Q3", "Q4");
@@ -137,4 +143,10 @@ public class GUIAm2901ALUInclSourceDecodeInclFunctionDecode extends SimpleRectan
                new GUIWire(submodelModifiable, alu.getPin("Cn+4"), Cnplus4, new Point(120, 60), new Point(120, 180));
                new GUIWire(submodelModifiable, alu.getPin("OVR"), OVR, new Point(115, 70), new Point(115, 220));
        }
+
+       static
+       {
+               IndirectGUIComponentCreator.setComponentSupplier(GUIAm2901ALUInclSourceDecodeInclFunctionDecode.class.getCanonicalName(),
+                               (m, p, n) -> new GUIAm2901ALUInclSourceDecodeInclFunctionDecode(m, n));
+       }
 }
\ No newline at end of file