X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fcomponents%2Fatomic%2FSimpleRectangularHardcodedGUIComponent.java;h=431240d75490a4bec58e5e868a6e47fbc586ffb0;hb=0a04a4ed66ecebd4254541c4977599f6052c115a;hp=c06ec1494bd47e903d6ac34fa2dd14d736513f7e;hpb=30b24889d4ae001113c6cac543fb8c29d15d0ff2;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedGUIComponent.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedGUIComponent.java index c06ec149..431240d7 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedGUIComponent.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedGUIComponent.java @@ -5,14 +5,14 @@ import java.util.concurrent.atomic.AtomicReference; import net.haspamelodica.swt.helper.gcs.GeneralGC; import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle; -import net.mograsim.logic.core.wires.Wire.ReadEnd; -import net.mograsim.logic.core.wires.Wire.ReadWriteEnd; +import net.mograsim.logic.core.wires.CoreWire.ReadEnd; +import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd; import net.mograsim.logic.model.model.ViewModelModifiable; import net.mograsim.logic.model.model.components.GUIComponent; import net.mograsim.logic.model.model.wires.Pin; import net.mograsim.logic.model.modeladapter.ViewLogicModelAdapter; import net.mograsim.logic.model.modeladapter.componentadapters.SimpleRectangularHardcodedGUIComponentAdapter; -import net.mograsim.logic.model.serializing.IdentifierGetter; +import net.mograsim.logic.model.serializing.IdentifyParams; import net.mograsim.logic.model.snippets.HighLevelStateHandler; import net.mograsim.logic.model.snippets.outlinerenderers.DefaultOutlineRenderer; import net.mograsim.logic.model.snippets.symbolrenderers.CenteredTextSymbolRenderer; @@ -27,6 +27,8 @@ public abstract class SimpleRectangularHardcodedGUIComponent extends GUIComponen private static final double pinNamesHeight = 3.5; private static final double pinNamesMargin = .5; + private final String id; + private final DefaultOutlineRenderer outlineRenderer; private final CenteredTextSymbolRenderer centerTextRenderer; private final PinNamesSymbolRenderer pinNamesRenderer; @@ -36,9 +38,10 @@ public abstract class SimpleRectangularHardcodedGUIComponent extends GUIComponen // creation and destruction - public SimpleRectangularHardcodedGUIComponent(ViewModelModifiable model, String name, String centerText) + public SimpleRectangularHardcodedGUIComponent(ViewModelModifiable model, String id, String name, String centerText) { super(model, name); + this.id = id; this.outlineRenderer = new DefaultOutlineRenderer(this); CenteredTextParams centeredTextParams = new CenteredTextParams(); centeredTextParams.text = centerText; @@ -52,7 +55,13 @@ public abstract class SimpleRectangularHardcodedGUIComponent extends GUIComponen setHighLevelStateHandler(new HighLevelStateHandler() { @Override - public Object getParamsForSerializing(IdentifierGetter idGetter) + public String getIDForSerializing(IdentifyParams idParams) + { + return null;// we don't need to serialize this; it's implicit since we are a SimpleRectangularHardcodedGUIComponent + } + + @Override + public Object getParamsForSerializing(IdentifyParams idParams) { return null; } @@ -121,6 +130,14 @@ public abstract class SimpleRectangularHardcodedGUIComponent extends GUIComponen pinNamesRenderer.render(gc, visibleRegion); } + // serializing + + @Override + public String getIDForSerializing(IdentifyParams idParams) + { + return id; + } + // operations no longer supported @Override