import org.eclipse.swt.graphics.Color;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonPrimitive;
+
import net.haspamelodica.swt.helper.gcs.GeneralGC;
import net.haspamelodica.swt.helper.swtobjectwrappers.Font;
import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
private MovablePin outputPin;
private final List<Pin> inputPins;
- public static final String kLogicWidth = "logicWidth";
-
protected SimpleRectangularGUIGate(ViewModelModifiable model, int logicWidth, String label, boolean isInverted)
{
super(model);
gc.drawText(label, getPosX() + (rectWidth - textExtent.x) / 2, getPosY() + (height - textExtent.y) / 2, true);
gc.setFont(oldFont);
}
+
+ // serializing
+
+ /**
+ * {@link SimpleRectangularGUIGate}s implementation returns a {@link JsonPrimitive} of type int containing the {@link #logicWidth} of
+ * this component.
+ *
+ * @see GUIComponent#getParams()
+ */
+ @Override
+ public JsonElement getParams()
+ {
+ return new JsonPrimitive(logicWidth);
+ }
}
\ No newline at end of file