GUIComponents now serialize and deserialize parameters (where needed)
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / components / GUIComponent.java
index 1699da5..58c725d 100644 (file)
@@ -7,6 +7,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.function.Consumer;
 
+import com.google.gson.JsonElement;
+import com.google.gson.JsonNull;
+
 import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.ui.model.ViewModelModifiable;
@@ -263,6 +266,14 @@ public abstract class GUIComponent
         */
        public abstract void render(GeneralGC gc, Rectangle visibleRegion);
 
+       // serializing
+
+       @SuppressWarnings("static-method") // this method is intended to be overridden
+       public JsonElement getParams()
+       {
+               return JsonNull.INSTANCE;
+       }
+
        // listeners
 
        /**