X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2FGUIComponent.java;h=58c725dfea4fb2d323f379c142a24221926c255b;hb=9ca90120a47e07c9182162351dc47aa89ae703be;hp=f9294036a20148bf3ad0e6fef789b0e67aaf9618;hpb=01c5d7035474a5eb58f216b6831b2c0d8c174efa;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponent.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponent.java index f9294036..58c725df 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponent.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponent.java @@ -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.
@@ -43,8 +43,6 @@ public abstract class GUIComponent private final List redrawListeners; private final Runnable redrawListenerForSubcomponents; - // Defines how the GUIComponent is referenced in SubmodelComponentParams - protected Supplier 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 getInstantiationParameters() + @SuppressWarnings("static-method") // this method is intended to be overridden + public JsonElement getParams() { - return new TreeMap<>(); + return JsonNull.INSTANCE; } // listeners