Package net.minecraft.client.gui.widget
Class ScrollableWidget
java.lang.Object
net.minecraft.client.gui.widget.ClickableWidget
net.minecraft.client.gui.widget.ScrollableWidget
- All Implemented Interfaces:
Drawable,Element,Narratable,Navigable,Selectable,Widget
- Direct Known Subclasses:
EditBoxWidget,TelemetryEventWidget
@Environment(CLIENT)
public abstract class ScrollableWidget
extends ClickableWidget
implements Drawable, Element
A widget that can be focused and vertically scrolled.
- Mappings:
Namespace Name intermediary net/minecraft/class_7528official eotnamed net/minecraft/client/gui/widget/ScrollableWidget
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.Selectable
Selectable.SelectionType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final intprivate booleanprivate doubleprivate static final intFields inherited from class net.minecraft.client.gui.widget.ClickableWidget
ACCESSIBILITY_TEXTURE, active, alpha, height, hovered, visible, WIDGETS_TEXTURE, widthFields inherited from interface net.minecraft.client.gui.Element
MAX_DOUBLE_CLICK_INTERVAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voiddrawBox(DrawContext context) Draws the box that the contents are rendered over, including its borders.private voiddrawScrollbar(DrawContext context) protected abstract intReturns the total height of the contents.private intprotected abstract doubleprotected intprotected intprotected intprivate intprotected doubleprotected booleanisVisible(int top, int bottom) protected booleanisWithinBounds(double mouseX, double mouseY) booleankeyPressed(int keyCode, int scanCode, int modifiers) Callback for when a key down event has been captured.booleanmouseClicked(double mouseX, double mouseY, int button) Callback for when a mouse button down event has been captured.booleanmouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) Callback for when a mouse button drag event has been captured.booleanmouseReleased(double mouseX, double mouseY, int button) Callback for when a mouse button release event has been captured.booleanmouseScrolled(double mouseX, double mouseY, double amount) Callback for when a mouse button scroll event has been captured.protected abstract booleanReturns whether the contents overflow and needs a scrollbar.voidrenderButton(DrawContext context, int mouseX, int mouseY, float delta) protected abstract voidrenderContents(DrawContext context, int mouseX, int mouseY, float delta) Renders the scrolled contents.protected voidrenderOverlay(DrawContext context) Renders overlays that are not scrolled but part of the widget.protected voidsetScrollY(double scrollY) Methods inherited from class net.minecraft.client.gui.widget.ClickableWidget
appendClickableNarrations, appendDefaultNarrations, appendNarrations, clicked, drawScrollableText, drawScrollableText, drawTexture, forEachChild, getHeight, getMessage, getNarrationMessage, getNarrationMessage, getNavigationFocus, getNavigationOrder, getNavigationPath, getTooltip, getTooltipPositioner, getType, getWidth, getX, getY, isFocused, isHovered, isMouseOver, isNarratable, isSelected, isValidClickButton, onClick, onDrag, onRelease, playDownSound, render, setAlpha, setFocused, setMessage, setNavigationOrder, setTooltip, setTooltipDelay, setWidth, setX, setYMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.Element
charTyped, getFocusedPath, getNavigationFocus, getNavigationPath, isFocused, isMouseOver, keyReleased, mouseMoved, setFocusedMethods inherited from interface net.minecraft.client.gui.navigation.Navigable
getNavigationOrderMethods inherited from interface net.minecraft.client.gui.widget.Widget
setPosition
-
Field Details
-
FOCUSED_BORDER_COLOR
private static final int FOCUSED_BORDER_COLOR- See Also:
- Mappings:
Namespace Name Mixin selector intermediary field_39493Lnet/minecraft/class_7528;field_39493:Iofficial aLeot;a:Inamed FOCUSED_BORDER_COLORLnet/minecraft/client/gui/widget/ScrollableWidget;FOCUSED_BORDER_COLOR:I
-
UNFOCUSED_BORDER_COLOR
private static final int UNFOCUSED_BORDER_COLOR- See Also:
- Mappings:
Namespace Name Mixin selector intermediary field_39494Lnet/minecraft/class_7528;field_39494:Iofficial bLeot;b:Inamed UNFOCUSED_BORDER_COLORLnet/minecraft/client/gui/widget/ScrollableWidget;UNFOCUSED_BORDER_COLOR:I
-
BOX_COLOR
private static final int BOX_COLOR- See Also:
- Mappings:
Namespace Name Mixin selector intermediary field_39495Lnet/minecraft/class_7528;field_39495:Iofficial cLeot;c:Inamed BOX_COLORLnet/minecraft/client/gui/widget/ScrollableWidget;BOX_COLOR:I
-
PADDING
private static final int PADDING- See Also:
- Mappings:
Namespace Name Mixin selector intermediary field_39496Lnet/minecraft/class_7528;field_39496:Iofficial dLeot;d:Inamed PADDINGLnet/minecraft/client/gui/widget/ScrollableWidget;PADDING:I
-
scrollY
private double scrollY- Mappings:
Namespace Name Mixin selector intermediary field_39497Lnet/minecraft/class_7528;field_39497:Dofficial eLeot;e:Dnamed scrollYLnet/minecraft/client/gui/widget/ScrollableWidget;scrollY:D
-
scrollbarDragged
private boolean scrollbarDragged- Mappings:
Namespace Name Mixin selector intermediary field_39498Lnet/minecraft/class_7528;field_39498:Zofficial fLeot;f:Znamed scrollbarDraggedLnet/minecraft/client/gui/widget/ScrollableWidget;scrollbarDragged:Z
-
-
Constructor Details
-
ScrollableWidget
- Mappings:
Namespace Name Mixin selector intermediary <init>Lnet/minecraft/class_339;<init>(IIIILnet/minecraft/class_2561;)Vofficial <init>Leox;<init>(IIIILsw;)Vnamed <init>Lnet/minecraft/client/gui/widget/ClickableWidget;<init>(IIIILnet/minecraft/text/Text;)V
-
-
Method Details
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) Callback for when a mouse button down event has been captured. The button number is identified by the constants inGLFWclass.- Specified by:
mouseClickedin interfaceElement- Overrides:
mouseClickedin classClickableWidget- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mousebutton- the mouse button number- Returns:
trueto indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector intermediary method_25402Lnet/minecraft/class_364;method_25402(DDI)Zofficial aLeqk;a(DDI)Znamed mouseClickedLnet/minecraft/client/gui/Element;mouseClicked(DDI)Z
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int button) Callback for when a mouse button release event has been captured. The button number is identified by the constants inGLFWclass.- Specified by:
mouseReleasedin interfaceElement- Overrides:
mouseReleasedin classClickableWidget- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mousebutton- the mouse button number- Returns:
trueto indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector intermediary method_25406Lnet/minecraft/class_364;method_25406(DDI)Zofficial bLeqk;b(DDI)Znamed mouseReleasedLnet/minecraft/client/gui/Element;mouseReleased(DDI)Z
-
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) Callback for when a mouse button drag event has been captured. The button number is identified by the constants inGLFWclass.- Specified by:
mouseDraggedin interfaceElement- Overrides:
mouseDraggedin classClickableWidget- Parameters:
mouseX- the current X coordinate of the mousemouseY- the current Y coordinate of the mousebutton- the mouse button numberdeltaX- the difference of the current X with the previous X coordinatedeltaY- the difference of the current Y with the previous Y coordinate- Returns:
trueto indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector intermediary method_25403Lnet/minecraft/class_364;method_25403(DDIDD)Zofficial aLeqk;a(DDIDD)Znamed mouseDraggedLnet/minecraft/client/gui/Element;mouseDragged(DDIDD)Z
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double amount) Callback for when a mouse button scroll event has been captured.- Specified by:
mouseScrolledin interfaceElement- Parameters:
mouseX- the X coordinate of the mousemouseY- the Y coordinate of the mouseamount- value is< 0if scrolled down,> 0if scrolled up- Returns:
trueto indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector intermediary method_25401Lnet/minecraft/class_364;method_25401(DDD)Zofficial aLeqk;a(DDD)Znamed mouseScrolledLnet/minecraft/client/gui/Element;mouseScrolled(DDD)Z
-
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) Callback for when a key down event has been captured. The key code is identified by the constants inGLFWclass.- Specified by:
keyPressedin interfaceElement- Parameters:
keyCode- the named key code of the event as described in theGLFWclassscanCode- the unique/platform-specific scan code of the keyboard inputmodifiers- a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)- Returns:
trueto indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector intermediary method_25404Lnet/minecraft/class_364;method_25404(III)Zofficial aLeqk;a(III)Znamed keyPressedLnet/minecraft/client/gui/Element;keyPressed(III)Z
-
renderButton
- Specified by:
renderButtonin classClickableWidget- Mappings:
Namespace Name Mixin selector intermediary method_48579Lnet/minecraft/class_339;method_48579(Lnet/minecraft/class_332;IIF)Vofficial bLeox;b(Leop;IIF)Vnamed renderButtonLnet/minecraft/client/gui/widget/ClickableWidget;renderButton(Lnet/minecraft/client/gui/DrawContext;IIF)V
-
getScrollbarThumbHeight
private int getScrollbarThumbHeight()- Mappings:
Namespace Name Mixin selector intermediary method_44394Lnet/minecraft/class_7528;method_44394()Iofficial vLeot;v()Inamed getScrollbarThumbHeightLnet/minecraft/client/gui/widget/ScrollableWidget;getScrollbarThumbHeight()I
-
renderOverlay
Renders overlays that are not scrolled but part of the widget.This renders the scrollbar by default. Subclasses can override this to render other overlays, but
supercall is necessary to make sure the scrollbar renders when it should.- Mappings:
Namespace Name Mixin selector intermediary method_44384Lnet/minecraft/class_7528;method_44384(Lnet/minecraft/class_332;)Vofficial aLeot;a(Leop;)Vnamed renderOverlayLnet/minecraft/client/gui/widget/ScrollableWidget;renderOverlay(Lnet/minecraft/client/gui/DrawContext;)V
-
getPadding
protected int getPadding()- Mappings:
Namespace Name Mixin selector intermediary method_44381Lnet/minecraft/class_7528;method_44381()Iofficial aLeot;a()Inamed getPaddingLnet/minecraft/client/gui/widget/ScrollableWidget;getPadding()I
-
getPaddingDoubled
protected int getPaddingDoubled()- Mappings:
Namespace Name Mixin selector intermediary method_44385Lnet/minecraft/class_7528;method_44385()Iofficial bLeot;b()Inamed getPaddingDoubledLnet/minecraft/client/gui/widget/ScrollableWidget;getPaddingDoubled()I
-
getScrollY
protected double getScrollY()- Mappings:
Namespace Name Mixin selector intermediary method_44387Lnet/minecraft/class_7528;method_44387()Dofficial cLeot;c()Dnamed getScrollYLnet/minecraft/client/gui/widget/ScrollableWidget;getScrollY()D
-
setScrollY
protected void setScrollY(double scrollY) - Mappings:
Namespace Name Mixin selector intermediary method_44382Lnet/minecraft/class_7528;method_44382(D)Vofficial aLeot;a(D)Vnamed setScrollYLnet/minecraft/client/gui/widget/ScrollableWidget;setScrollY(D)V
-
getMaxScrollY
protected int getMaxScrollY()- Mappings:
Namespace Name Mixin selector intermediary method_44390Lnet/minecraft/class_7528;method_44390()Iofficial dLeot;d()Inamed getMaxScrollYLnet/minecraft/client/gui/widget/ScrollableWidget;getMaxScrollY()I
-
getContentsHeightWithPadding
private int getContentsHeightWithPadding()- Mappings:
Namespace Name Mixin selector intermediary method_44395Lnet/minecraft/class_7528;method_44395()Iofficial wLeot;w()Inamed getContentsHeightWithPaddingLnet/minecraft/client/gui/widget/ScrollableWidget;getContentsHeightWithPadding()I
-
drawBox
Draws the box that the contents are rendered over, including its borders.- Mappings:
Namespace Name Mixin selector intermediary method_44386Lnet/minecraft/class_7528;method_44386(Lnet/minecraft/class_332;)Vofficial bLeot;b(Leop;)Vnamed drawBoxLnet/minecraft/client/gui/widget/ScrollableWidget;drawBox(Lnet/minecraft/client/gui/DrawContext;)V
-
drawScrollbar
- Mappings:
Namespace Name Mixin selector intermediary method_44396Lnet/minecraft/class_7528;method_44396(Lnet/minecraft/class_332;)Vofficial cLeot;c(Leop;)Vnamed drawScrollbarLnet/minecraft/client/gui/widget/ScrollableWidget;drawScrollbar(Lnet/minecraft/client/gui/DrawContext;)V
-
isVisible
protected boolean isVisible(int top, int bottom) - Mappings:
Namespace Name Mixin selector intermediary method_44383Lnet/minecraft/class_7528;method_44383(II)Zofficial aLeot;a(II)Znamed isVisibleLnet/minecraft/client/gui/widget/ScrollableWidget;isVisible(II)Z
-
isWithinBounds
protected boolean isWithinBounds(double mouseX, double mouseY) - Mappings:
Namespace Name Mixin selector intermediary method_44388Lnet/minecraft/class_7528;method_44388(DD)Zofficial cLeot;c(DD)Znamed isWithinBoundsLnet/minecraft/client/gui/widget/ScrollableWidget;isWithinBounds(DD)Z
-
getContentsHeight
protected abstract int getContentsHeight()Returns the total height of the contents.- Returns:
- the total height of the contents
- Mappings:
Namespace Name Mixin selector intermediary method_44391Lnet/minecraft/class_7528;method_44391()Iofficial eLeot;e()Inamed getContentsHeightLnet/minecraft/client/gui/widget/ScrollableWidget;getContentsHeight()I
-
overflows
protected abstract boolean overflows()Returns whether the contents overflow and needs a scrollbar.- Returns:
- whether the contents overflow and needs a scrollbar
- Mappings:
Namespace Name Mixin selector intermediary method_44392Lnet/minecraft/class_7528;method_44392()Zofficial fLeot;f()Znamed overflowsLnet/minecraft/client/gui/widget/ScrollableWidget;overflows()Z
-
getDeltaYPerScroll
protected abstract double getDeltaYPerScroll()- Mappings:
Namespace Name Mixin selector intermediary method_44393Lnet/minecraft/class_7528;method_44393()Dofficial gLeot;g()Dnamed getDeltaYPerScrollLnet/minecraft/client/gui/widget/ScrollableWidget;getDeltaYPerScroll()D
-
renderContents
Renders the scrolled contents. Subclasses must override this. The rendered contents may overflow; the caller should trim those usingDrawContext.enableScissor(int, int, int, int).- Mappings:
Namespace Name Mixin selector intermediary method_44389Lnet/minecraft/class_7528;method_44389(Lnet/minecraft/class_332;IIF)Vofficial cLeot;c(Leop;IIF)Vnamed renderContentsLnet/minecraft/client/gui/widget/ScrollableWidget;renderContents(Lnet/minecraft/client/gui/DrawContext;IIF)V
-