From 7c7e8d9b5415871f242fb82ec10f88db6ad2a90a Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Fri, 10 Jul 2020 18:44:06 +0300 Subject: Add since tags and a package-info for the icon package --- .../java/io/github/cottonmc/cotton/gui/widget/WButton.java | 1 + .../cottonmc/cotton/gui/widget/icon/TextureIcon.java | 2 ++ .../cottonmc/cotton/gui/widget/icon/package-info.java | 14 ++++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 src/main/java/io/github/cottonmc/cotton/gui/widget/icon/package-info.java (limited to 'src/main/java') diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java index 18da1e4..f65b513 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java @@ -56,6 +56,7 @@ public class WButton extends WWidget { * * @param icon the icon * @param label the label + * @since 2.2.0 */ public WButton(Icon icon, StringRenderable label) { this.icon = icon; diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/TextureIcon.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/TextureIcon.java index e614e4b..0fec0fa 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/TextureIcon.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/TextureIcon.java @@ -8,6 +8,8 @@ import net.minecraft.util.Identifier; /** * An icon that draws a texture. + * + * @since 2.2.0 */ public class TextureIcon implements Icon { private final Identifier texture; diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/package-info.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/package-info.java new file mode 100644 index 0000000..54bbc92 --- /dev/null +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/icon/package-info.java @@ -0,0 +1,14 @@ +/** + * The icon API for displaying various icons on widgets. + * + *

For example, you can attach an icon to a button: + *

+ * {@code
+ * // This is a button with an apple item as the icon:
+ * WButton button = new WButton(new ItemIcon(new ItemStack(Items.APPLE)), new LiteralText("Apple button"));
+ * }
+ * 
+ * + * @since 2.2.0 + */ +package io.github.cottonmc.cotton.gui.widget.icon; -- cgit