X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fcomponents%2FGUIComponent.java;h=2ffe890f27e35e23a0662d1bdf0fcbf0ec7a1766;hb=a36b5eded424a8c480140e9ce853145c2bcc9d7e;hp=1cf7460f81af679671497161b7962a38bf653909;hpb=020445ceb5c54ee5ff384a7e6b529ee350575b12;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/GUIComponent.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/GUIComponent.java index 1cf7460f..2ffe890f 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/GUIComponent.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/GUIComponent.java @@ -14,6 +14,8 @@ import net.haspamelodica.swt.helper.gcs.GeneralGC; import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; import net.mograsim.logic.model.model.ViewModelModifiable; import net.mograsim.logic.model.model.wires.Pin; +import net.mograsim.logic.model.serializing.IdentifierGetter; +import net.mograsim.logic.model.serializing.JSONSerializable; import net.mograsim.logic.model.snippets.HighLevelStateHandler; /** @@ -24,7 +26,7 @@ import net.mograsim.logic.model.snippets.HighLevelStateHandler; * * @author Daniel Kirschten */ -public abstract class GUIComponent +public abstract class GUIComponent implements JSONSerializable { /** * The model this component is a part of. @@ -72,6 +74,8 @@ public abstract class GUIComponent redrawListenerForSubcomponents = this::requestRedraw; + // TODO this will crash the high level state debug shell because submodel is not yet set. + // The same problem exists in ViewModelModifiable.getDefaultComponentName; see there model.componentCreated(this); } @@ -159,6 +163,11 @@ public abstract class GUIComponent this.highLevelStateHandler = highLevelStateHandler; } + public HighLevelStateHandler getHighLevelStateHandler() + { + return highLevelStateHandler; + } + /** * Gets the current value of the given high-level state.
* See {@link HighLevelStateHandler} for an explanation of high-level state IDs. @@ -287,8 +296,8 @@ public abstract class GUIComponent // serializing - @SuppressWarnings("static-method") // this method is intended to be overridden - public JsonElement getParamsForSerializing() + @Override + public JsonElement getParamsForSerializing(IdentifierGetter idGetter) { return JsonNull.INSTANCE; }