From 1764648e4f536b2e6ac1b7d1cb3c3fb60e206b29 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Thu, 19 Mar 2020 04:22:55 +0800 Subject: remove old Rectangle Signed-off-by: shedaniel --- .../me/shedaniel/rei/gui/widget/LabelWidget.java | 30 +++------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java') diff --git a/src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java index 9a1ebcff1..a2d35006b 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java @@ -24,7 +24,7 @@ package me.shedaniel.rei.gui.widget; import me.shedaniel.math.Point; -import me.shedaniel.math.api.Rectangle; +import me.shedaniel.math.Rectangle; import me.shedaniel.rei.api.REIHelper; import me.shedaniel.rei.api.widgets.Tooltip; import me.shedaniel.rei.api.widgets.Widgets; @@ -53,11 +53,6 @@ public class LabelWidget extends WidgetWithBounds { private boolean centered = true; private Supplier tooltipSupplier; - @ApiStatus.Internal - public LabelWidget(me.shedaniel.math.api.Point point, String text) { - this((Point) point, text); - } - @ApiStatus.Internal public LabelWidget(Point point, String text) { this.pos = point; @@ -69,14 +64,6 @@ public class LabelWidget extends WidgetWithBounds { return new LabelWidget(point, text); } - public static LabelWidget create(me.shedaniel.math.api.Point point, String text) { - return new LabelWidget(point, text); - } - - public static ClickableLabelWidget createClickable(me.shedaniel.math.api.Point point, String text, Consumer onClicked) { - return createClickable((Point) point, text, onClicked); - } - public static ClickableLabelWidget createClickable(Point point, String text, Consumer onClicked) { ClickableLabelWidget[] widget = {null}; widget[0] = new ClickableLabelWidget(point, text) { @@ -134,22 +121,11 @@ public class LabelWidget extends WidgetWithBounds { /** * @return the position of this label - * @deprecated Use {@link #getLocation()} */ - @Deprecated - @ApiStatus.ScheduledForRemoval - public me.shedaniel.math.api.Point getPosition() { - return new me.shedaniel.math.api.Point(getLocation()); - } - public Point getLocation() { return pos; } - public LabelWidget setPosition(me.shedaniel.math.api.Point position) { - return setLocation(position); - } - public LabelWidget setLocation(Point position) { this.pos = position; return this; @@ -177,7 +153,7 @@ public class LabelWidget extends WidgetWithBounds { @Override public Rectangle getBounds() { int width = font.getStringWidth(text); - Point pos = getPosition(); + Point pos = getLocation(); if (isCentered()) return new Rectangle(pos.x - width / 2 - 1, pos.y - 5, width + 2, 14); return new Rectangle(pos.x - 1, pos.y - 5, width + 2, 14); @@ -191,7 +167,7 @@ public class LabelWidget extends WidgetWithBounds { @Override public void render(int mouseX, int mouseY, float delta) { int width = font.getStringWidth(text); - Point pos = getPosition(); + Point pos = getLocation(); if (isCentered()) { if (hasShadows) font.drawWithShadow(text, pos.x - width / 2f, pos.y, defaultColor); -- cgit