Moved code serializing a symbol renderer to where it belongs
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / components / GUIComponent.java
index f929403..58c725d 100644 (file)
@@ -5,15 +5,15 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.TreeMap;
 import java.util.function.Consumer;
-import java.util.function.Supplier;
+
+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;
 import net.mograsim.logic.ui.model.wires.Pin;
-import net.mograsim.logic.ui.serializing.SubmodelComponentParams;
 
 /**
  * The base class for all GUI components.<br>
@@ -43,8 +43,6 @@ public abstract class GUIComponent
        private final List<Runnable> redrawListeners;
 
        private final Runnable redrawListenerForSubcomponents;
-       // Defines how the GUIComponent is referenced in SubmodelComponentParams
-       protected Supplier<String> identifierDelegate = () -> getClass().getSimpleName();
 
        // creation and destruction
 
@@ -270,18 +268,10 @@ public abstract class GUIComponent
 
        // serializing
 
-       /**
-        * @return an identifier used to reference this GUIComponent inside of {@link SubmodelComponentParams}
-        */
-       public String getIdentifier()
-       {
-               return identifierDelegate.get();
-       }
-
-       @SuppressWarnings("static-method")
-       public Map<String, Object> getInstantiationParameters()
+       @SuppressWarnings("static-method") // this method is intended to be overridden
+       public JsonElement getParams()
        {
-               return new TreeMap<>();
+               return JsonNull.INSTANCE;
        }
 
        // listeners