X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fcomponents%2Fsubmodels%2FSubmodelComponent.java;h=5aa5e38c4481580a80bf6dc4414124421492be89;hb=43f832fac0531473dc97af75edb7c5b1cb9f6ce4;hp=ffe6ed63fdcea8247186541ef879df7219411a3b;hpb=92862c4723c5eff22257e8de06166a124efb5d77;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/submodels/SubmodelComponent.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/submodels/SubmodelComponent.java index ffe6ed63..5aa5e38c 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/submodels/SubmodelComponent.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/submodels/SubmodelComponent.java @@ -115,7 +115,7 @@ public abstract class SubmodelComponent extends ModelComponent this.supermodelPins = new HashMap<>(); this.supermodelMovablePinsUnmodifiable = Collections.unmodifiableMap(supermodelPins); this.supermodelUnmovablePinsUnmodifiable = Collections.unmodifiableMap(supermodelPins); - this.submodelInterface = new SubmodelInterface(submodelModifiable, SUBMODEL_INTERFACE_NAME); + this.submodelInterface = new SubmodelInterface(submodelModifiable); this.submodelScale = 1; this.maxVisibleRegionFillRatioForAlpha0 = 0.8; @@ -429,14 +429,28 @@ public abstract class SubmodelComponent extends ModelComponent // serializing + /** + * {@link SubmodelComponent}'s implementation of {@link ModelComponent#getIDForSerializing(IdentifyParams)} returns "submodel". It is + * recommended to override this behaviour. + * + * @see ModelComponent#getIDForSerializing(IdentifyParams) + * @see ModelComponent#getParamsForSerializing(IdentifyParams) + */ @Override public String getIDForSerializing(IdentifyParams idParams) { return "submodel";// TODO what ID? } + /** + * {@link SubmodelComponent}'s implementation of {@link ModelComponent#getParamsForSerializing(IdentifyParams)} returns an instance of + * {@link SubmodelComponentParams}. It is recommended to override this behaviour. + * + * @see ModelComponent#getIDForSerializing(IdentifyParams) + * @see ModelComponent#getParamsForSerializing(IdentifyParams) + */ @Override - public SubmodelComponentParams getParamsForSerializing(IdentifyParams idParams) + public Object getParamsForSerializing(IdentifyParams idParams) { return SubmodelComponentSerializer.serialize(this, idParams); }