diff options
author | Juuz <6596629+Juuxel@users.noreply.github.com> | 2023-10-15 14:20:36 +0300 |
---|---|---|
committer | Juuz <6596629+Juuxel@users.noreply.github.com> | 2023-10-15 14:20:36 +0300 |
commit | 7aca06c3ee4dcd28da4221ec7f904ee5fed0c237 (patch) | |
tree | 35c09254a01a0139d85c667020f5c125271fd2cb | |
parent | 3e74a563b2d2d3e0683733c3b4e52bac768659fd (diff) | |
download | LibGui-7aca06c3ee4dcd28da4221ec7f904ee5fed0c237.tar.gz LibGui-7aca06c3ee4dcd28da4221ec7f904ee5fed0c237.tar.bz2 LibGui-7aca06c3ee4dcd28da4221ec7f904ee5fed0c237.zip |
WScrollBar: Minor javadoc and formatting fixes
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java index ac5ddcb..d565d12 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java @@ -15,8 +15,14 @@ import io.github.cottonmc.cotton.gui.widget.data.InputResult; public class WScrollBar extends WWidget { private static final Identifier FOCUS_TEXTURE = new Identifier(LibGuiCommon.MOD_ID, "widget/scroll_bar/focus"); + + /** + * The default {@linkplain #getScrollingSpeed() scrolling speed for mouse inputs}. + * + * @since 9.0.0 + */ public static final int DEFAULT_SCROLLING_SPEED = 4; - private int scrollingSpeed = 4; + private int scrollingSpeed = DEFAULT_SCROLLING_SPEED; protected Axis axis = Axis.HORIZONTAL; protected int value; @@ -229,24 +235,25 @@ public class WScrollBar extends WWidget { } /** - * Sets the mouse scroll speed; - * <p> - * Default value: {@value #DEFAULT_SCROLLING_SPEED} - * @param scrollingSpeed the scroll speed + * Sets the mouse scroll speed. + * + * <p>By default, the scrolling speed is {@value #DEFAULT_SCROLLING_SPEED}. + * + * @param scrollingSpeed the scroll speed, must be positive * @return this scroll bar */ public WScrollBar setScrollingSpeed(int scrollingSpeed) { - if(scrollingSpeed < 0) throw new IllegalArgumentException("Negative value for scrolling speed"); - if(scrollingSpeed == 0) throw new IllegalArgumentException("Zero value for scrolling speed"); + if (scrollingSpeed < 0) throw new IllegalArgumentException("Negative value for scrolling speed"); + if (scrollingSpeed == 0) throw new IllegalArgumentException("Zero value for scrolling speed"); this.scrollingSpeed = scrollingSpeed; return this; } /** - * Gets the mouse scroll speed; - * <p> - * Default value: {@value #DEFAULT_SCROLLING_SPEED} + * {@return the default mouse scroll speed} + * + * <p>By default, the scrolling speed is {@value #DEFAULT_SCROLLING_SPEED}. */ public int getScrollingSpeed() { return scrollingSpeed; |