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=e343c586c41a1b4ef2f1ccfbabaf485b0cd3fdc8;hb=0a0877d1d0fca51260e66d65da3636752ded4242;hp=9535d3b8ef239cd3f07ba5d4067c1e5064499d33;hpb=c5c0d07286a29994a11ba8b01eaffb21964b6c1b;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 9535d3b8..e343c586 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 @@ -16,6 +16,8 @@ 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; public class SimpleRectangularGUIGate extends GUIComponent @@ -40,7 +42,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); @@ -57,7 +59,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); } @@ -67,7 +69,7 @@ public class SimpleRectangularGUIGate extends GUIComponent @Override public void render(GeneralGC gc, Rectangle visibleRegion) { - Color foreground = Preferences.current().getColor("net.mograsim.logic.ui.color.foreground"); + Color foreground = Preferences.current().getColor("net.mograsim.logic.model.color.foreground"); if (foreground != null) gc.setForeground(foreground); double height = (getPins().size() - 1) * pinDistance; @@ -78,7 +80,7 @@ public class SimpleRectangularGUIGate extends GUIComponent Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle()); gc.setFont(labelFont); Point textExtent = gc.textExtent(label); - Color textColor = Preferences.current().getColor("net.mograsim.logic.ui.color.text"); + Color textColor = Preferences.current().getColor("net.mograsim.logic.model.color.text"); if (textColor != null) gc.setForeground(textColor); gc.drawText(label, getPosX() + (rectWidth - textExtent.x) / 2, getPosY() + (height - textExtent.y) / 2, true); @@ -94,7 +96,7 @@ public class SimpleRectangularGUIGate extends GUIComponent * @see GUIComponent#getParamsForSerializing() */ @Override - public JsonElement getParamsForSerializing() + public JsonElement getParamsForSerializing(IdentifierGetter idGetter) { return new JsonPrimitive(logicWidth); }