From 5a2b3336017ff807ba2a0179ff07f7812ae0c6b4 Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Thu, 26 Nov 2020 22:27:30 +0200 Subject: Remove deprecated features - WWidget.createPeers (replaced by validate) - WTabPanel.Tab constructor (replaced by builder) --- .../java/io/github/cottonmc/cotton/gui/widget/WCardPanel.java | 10 ---------- src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java | 10 ---------- .../java/io/github/cottonmc/cotton/gui/widget/WTabPanel.java | 4 +--- .../java/io/github/cottonmc/cotton/gui/widget/WWidget.java | 9 --------- 4 files changed, 1 insertion(+), 32 deletions(-) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WCardPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WCardPanel.java index 3d1da6a..8caad27 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WCardPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WCardPanel.java @@ -178,16 +178,6 @@ public class WCardPanel extends WPanel { card.validate(c); if (getSelectedCard() != card) card.onHidden(); } - - if (c != null) createPeers(c); - } - - @SuppressWarnings("deprecation") - @Override - public void createPeers(GuiDescription c) { - for (WWidget card : cards) { - card.createPeers(c); - } } @Environment(EnvType.CLIENT) diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java index 90ef5d6..2576d46 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java @@ -26,15 +26,6 @@ public abstract class WPanel extends WWidget { @Environment(EnvType.CLIENT) private BackgroundPainter backgroundPainter = null; - @SuppressWarnings("deprecation") - @Override - public void createPeers(GuiDescription c) { - super.createPeers(c); - for(WWidget child : children) { - child.createPeers(c); - } - } - /** * Removes the widget from this panel. * @@ -188,7 +179,6 @@ public abstract class WPanel extends WWidget { for (WWidget child : children) { child.validate(c); } - if (c!=null) createPeers(c); } @Environment(EnvType.CLIENT) diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTabPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTabPanel.java index efb71d5..9e17d37 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTabPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTabPanel.java @@ -120,10 +120,8 @@ public class WTabPanel extends WPanel { * @param tooltip the tab tooltip * @throws IllegalArgumentException if both the title and the icon are null * @throws NullPointerException if the widget is null - * @deprecated Use {@link Builder} instead. */ - @Deprecated - public Tab(@Nullable Text title, @Nullable Icon icon, WWidget widget, @Nullable Consumer tooltip) { + private Tab(@Nullable Text title, @Nullable Icon icon, WWidget widget, @Nullable Consumer tooltip) { if (title == null && icon == null) { throw new IllegalArgumentException("A tab must have a title or an icon"); } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java index 98b87b6..a77bd5e 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java @@ -304,15 +304,6 @@ public class WWidget { return false; } - /** - * Creates "heavyweight" component peers - * @param c the top-level Container that will hold the peers - * @deprecated All widget peers should be added in {@link #validate(GuiDescription)}. - */ - @Deprecated - public void createPeers(GuiDescription c) { - } - /** * Paints this widget. * -- cgit