aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-11-26 22:27:30 +0200
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-11-26 22:27:30 +0200
commit5a2b3336017ff807ba2a0179ff07f7812ae0c6b4 (patch)
tree405222be20f6bbecb2898a83a498381723b91e94
parent1bdc7ebab4c94fbb5fab8946a3f3e07cee389397 (diff)
downloadLibGui-5a2b3336017ff807ba2a0179ff07f7812ae0c6b4.tar.gz
LibGui-5a2b3336017ff807ba2a0179ff07f7812ae0c6b4.tar.bz2
LibGui-5a2b3336017ff807ba2a0179ff07f7812ae0c6b4.zip
Remove deprecated features
- WWidget.createPeers (replaced by validate) - WTabPanel.Tab constructor (replaced by builder)
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WCardPanel.java10
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java10
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WTabPanel.java4
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WWidget.java9
4 files changed, 1 insertions, 32 deletions
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<TooltipBuilder> tooltip) {
+ private Tab(@Nullable Text title, @Nullable Icon icon, WWidget widget, @Nullable Consumer<TooltipBuilder> 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
@@ -305,15 +305,6 @@ public class WWidget {
}
/**
- * 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.
*
* @param matrices the rendering matrix stack