Updated SubmodelComponentParams json format
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / components / SimpleRectangularGUIGate.java
index 9058d2e..96bf11e 100644 (file)
@@ -2,6 +2,7 @@ package net.mograsim.logic.ui.model.components;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Font;
@@ -26,6 +27,8 @@ public class SimpleRectangularGUIGate extends GUIComponent
        private MovablePin outputPin;
        private final List<Pin> inputPins;
 
+       public static final String kLogicWidth = "logicWidth";
+
        protected SimpleRectangularGUIGate(ViewModelModifiable model, int logicWidth, String label, boolean isInverted)
        {
                super(model);
@@ -74,4 +77,12 @@ public class SimpleRectangularGUIGate extends GUIComponent
                if (isInverted)
                        gc.drawOval(posX + rectWidth, posY + (height - invertedCircleDiam) / 2, invertedCircleDiam, invertedCircleDiam);
        }
+
+       @Override
+       public Map<String, Object> getInstantiationParameters()
+       {
+               Map<String, Object> m = super.getInstantiationParameters();
+               m.put(kLogicWidth, logicWidth);
+               return m;
+       }
 }
\ No newline at end of file