X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fcomponents%2Fatomic%2FSimpleRectangularGUIGate.java;h=86582c7a5b81dcf7f81c89513fe36a6739d4541c;hb=c202aac61021b9d12e4ac6495001bcd012cecde0;hp=ef7d0101d2194dd4c37925a5a25d711f7dc74d5c;hpb=a47c9b1f38bbb6d2f5a3c482f3b09d1f42270401;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularGUIGate.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularGUIGate.java index ef7d0101..86582c7a 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularGUIGate.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularGUIGate.java @@ -5,7 +5,6 @@ import java.util.List; import org.eclipse.swt.graphics.Color; -import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; import net.haspamelodica.swt.helper.gcs.GeneralGC; @@ -16,6 +15,7 @@ import net.mograsim.logic.model.model.ViewModelModifiable; import net.mograsim.logic.model.model.components.GUIComponent; import net.mograsim.logic.model.model.wires.MovablePin; import net.mograsim.logic.model.model.wires.Pin; +import net.mograsim.logic.model.model.wires.PinUsage; import net.mograsim.logic.model.serializing.IdentifierGetter; import net.mograsim.preferences.Preferences; @@ -41,7 +41,7 @@ public class SimpleRectangularGUIGate extends GUIComponent this.logicWidth = logicWidth; this.isInverted = isInverted; this.rectWidth = width - (isInverted ? invertedCircleDiam : 0); - this.outputPin = new MovablePin(this, "Y", logicWidth, width, 0); + this.outputPin = new MovablePin(this, "Y", logicWidth, PinUsage.OUTPUT, width, 0); addPin(outputPin); this.inputPins = new ArrayList<>(); setInputCount(1); @@ -58,7 +58,7 @@ public class SimpleRectangularGUIGate extends GUIComponent for (int i = oldInputCount; i < inputCount; i++) { // TODO what for more than 24 input pins? - Pin pin = new Pin(this, String.valueOf((char) ('A' + i)), logicWidth, 0, pinDistance / 2 + i * pinDistance); + Pin pin = new Pin(this, String.valueOf((char) ('A' + i)), logicWidth, PinUsage.INPUT, 0, pinDistance / 2 + i * pinDistance); inputPins.add(pin); addPin(pin); } @@ -95,8 +95,8 @@ public class SimpleRectangularGUIGate extends GUIComponent * @see GUIComponent#getParamsForSerializing() */ @Override - public JsonElement getParamsForSerializing(IdentifierGetter idGetter) + public Integer getParamsForSerializing(IdentifierGetter idGetter) { - return new JsonPrimitive(logicWidth); + return logicWidth; } } \ No newline at end of file