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,ScrollableTextWidget,TelemetryEventWidget
@Environment(CLIENT)
public abstract class ScrollableWidget
extends ClickableWidget
implements Drawable, Element
A widget that can be focused and vertically scrolled.
- Mappings:
Namespace Name official esbintermediary net/minecraft/class_7528named 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 ButtonTexturesprivate static final Identifierprivate static final intprivate static final intprivate booleanprivate doubleFields inherited from class net.minecraft.client.gui.widget.ClickableWidget
active, alpha, height, hovered, visible, widthFields inherited from interface net.minecraft.client.gui.Element
MAX_DOUBLE_CLICK_INTERVAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawBox(DrawContext context) Draws the box that the contents are rendered over, including its borders.protected voiddrawBox(DrawContext drawContext, int int2, int int3, int width, int height) 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 horizontalAmount, double verticalAmount) Callback for when a mouse button scroll event has been captured.protected 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, drawScrollableText, 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
-
field_45905
- Mappings:
Namespace Name Mixin selector official aLesb;a:Lets;intermediary field_45905Lnet/minecraft/class_7528;field_45905:Lnet/minecraft/class_8666;named field_45905Lnet/minecraft/client/gui/widget/ScrollableWidget;field_45905:Lnet/minecraft/client/gui/screen/ButtonTextures;
-
field_45906
- Mappings:
Namespace Name Mixin selector official bLesb;b:Laer;intermediary field_45906Lnet/minecraft/class_7528;field_45906:Lnet/minecraft/class_2960;named field_45906Lnet/minecraft/client/gui/widget/ScrollableWidget;field_45906:Lnet/minecraft/util/Identifier;
-
PADDING
private static final int PADDING- See Also:
- Mappings:
Namespace Name Mixin selector official cLesb;c:Iintermediary field_39496Lnet/minecraft/class_7528;field_39496:Inamed PADDINGLnet/minecraft/client/gui/widget/ScrollableWidget;PADDING:I
-
field_45907
private static final int field_45907- See Also:
- Mappings:
Namespace Name Mixin selector official dLesb;d:Iintermediary field_45907Lnet/minecraft/class_7528;field_45907:Inamed field_45907Lnet/minecraft/client/gui/widget/ScrollableWidget;field_45907:I
-
scrollY
private double scrollY- Mappings:
Namespace Name Mixin selector official eLesb;e:Dintermediary field_39497Lnet/minecraft/class_7528;field_39497:Dnamed scrollYLnet/minecraft/client/gui/widget/ScrollableWidget;scrollY:D
-
scrollbarDragged
private boolean scrollbarDragged- Mappings:
Namespace Name Mixin selector official lLesb;l:Zintermediary field_39498Lnet/minecraft/class_7528;field_39498:Znamed scrollbarDraggedLnet/minecraft/client/gui/widget/ScrollableWidget;scrollbarDragged:Z
-
-
Constructor Details
-
ScrollableWidget
- Mappings:
Namespace Name Mixin selector official <init>Lesf;<init>(IIIILtf;)Vintermediary <init>Lnet/minecraft/class_339;<init>(IIIILnet/minecraft/class_2561;)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 official aLeua;a(DDI)Zintermediary method_25402Lnet/minecraft/class_364;method_25402(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 official bLeua;b(DDI)Zintermediary method_25406Lnet/minecraft/class_364;method_25406(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 official aLeua;a(DDIDD)Zintermediary method_25403Lnet/minecraft/class_364;method_25403(DDIDD)Znamed mouseDraggedLnet/minecraft/client/gui/Element;mouseDragged(DDIDD)Z
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) 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 mousehorizontalAmount- the horizontal scroll amountverticalAmount- the vertical scroll amount- Returns:
trueto indicate that the event handling is successful/valid- See Also:
- Mappings:
Namespace Name Mixin selector official aLeua;a(DDDD)Zintermediary method_25401Lnet/minecraft/class_364;method_25401(DDDD)Znamed mouseScrolledLnet/minecraft/client/gui/Element;mouseScrolled(DDDD)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 official aLeua;a(III)Zintermediary method_25404Lnet/minecraft/class_364;method_25404(III)Znamed keyPressedLnet/minecraft/client/gui/Element;keyPressed(III)Z
-
renderButton
- Specified by:
renderButtonin classClickableWidget- Mappings:
Namespace Name Mixin selector official bLesf;b(Lerw;IIF)Vintermediary method_48579Lnet/minecraft/class_339;method_48579(Lnet/minecraft/class_332;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 official vLesb;v()Iintermediary method_44394Lnet/minecraft/class_7528;method_44394()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 official aLesb;a(Lerw;)Vintermediary method_44384Lnet/minecraft/class_7528;method_44384(Lnet/minecraft/class_332;)Vnamed renderOverlayLnet/minecraft/client/gui/widget/ScrollableWidget;renderOverlay(Lnet/minecraft/client/gui/DrawContext;)V
-
getPadding
protected int getPadding()- Mappings:
Namespace Name Mixin selector official aLesb;a()Iintermediary method_44381Lnet/minecraft/class_7528;method_44381()Inamed getPaddingLnet/minecraft/client/gui/widget/ScrollableWidget;getPadding()I
-
getPaddingDoubled
protected int getPaddingDoubled()- Mappings:
Namespace Name Mixin selector official bLesb;b()Iintermediary method_44385Lnet/minecraft/class_7528;method_44385()Inamed getPaddingDoubledLnet/minecraft/client/gui/widget/ScrollableWidget;getPaddingDoubled()I
-
getScrollY
protected double getScrollY()- Mappings:
Namespace Name Mixin selector official cLesb;c()Dintermediary method_44387Lnet/minecraft/class_7528;method_44387()Dnamed getScrollYLnet/minecraft/client/gui/widget/ScrollableWidget;getScrollY()D
-
setScrollY
protected void setScrollY(double scrollY) - Mappings:
Namespace Name Mixin selector official aLesb;a(D)Vintermediary method_44382Lnet/minecraft/class_7528;method_44382(D)Vnamed setScrollYLnet/minecraft/client/gui/widget/ScrollableWidget;setScrollY(D)V
-
getMaxScrollY
protected int getMaxScrollY()- Mappings:
Namespace Name Mixin selector official dLesb;d()Iintermediary method_44390Lnet/minecraft/class_7528;method_44390()Inamed getMaxScrollYLnet/minecraft/client/gui/widget/ScrollableWidget;getMaxScrollY()I
-
getContentsHeightWithPadding
private int getContentsHeightWithPadding()- Mappings:
Namespace Name Mixin selector official wLesb;w()Iintermediary method_44395Lnet/minecraft/class_7528;method_44395()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 official bLesb;b(Lerw;)Vintermediary method_44386Lnet/minecraft/class_7528;method_44386(Lnet/minecraft/class_332;)Vnamed drawBoxLnet/minecraft/client/gui/widget/ScrollableWidget;drawBox(Lnet/minecraft/client/gui/DrawContext;)V
-
drawBox
- Mappings:
Namespace Name Mixin selector official aLesb;a(Lerw;IIII)Vintermediary method_52233Lnet/minecraft/class_7528;method_52233(Lnet/minecraft/class_332;IIII)Vnamed drawBoxLnet/minecraft/client/gui/widget/ScrollableWidget;drawBox(Lnet/minecraft/client/gui/DrawContext;IIII)V
-
drawScrollbar
- Mappings:
Namespace Name Mixin selector official cLesb;c(Lerw;)Vintermediary method_44396Lnet/minecraft/class_7528;method_44396(Lnet/minecraft/class_332;)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 official aLesb;a(II)Zintermediary method_44383Lnet/minecraft/class_7528;method_44383(II)Znamed isVisibleLnet/minecraft/client/gui/widget/ScrollableWidget;isVisible(II)Z
-
isWithinBounds
protected boolean isWithinBounds(double mouseX, double mouseY) - Mappings:
Namespace Name Mixin selector official cLesb;c(DD)Zintermediary method_44388Lnet/minecraft/class_7528;method_44388(DD)Znamed isWithinBoundsLnet/minecraft/client/gui/widget/ScrollableWidget;isWithinBounds(DD)Z
-
overflows
protected 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 official eLesb;e()Zintermediary method_44392Lnet/minecraft/class_7528;method_44392()Znamed overflowsLnet/minecraft/client/gui/widget/ScrollableWidget;overflows()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 official fLesb;f()Iintermediary method_44391Lnet/minecraft/class_7528;method_44391()Inamed getContentsHeightLnet/minecraft/client/gui/widget/ScrollableWidget;getContentsHeight()I
-
getDeltaYPerScroll
protected abstract double getDeltaYPerScroll()- Mappings:
Namespace Name Mixin selector official gLesb;g()Dintermediary method_44393Lnet/minecraft/class_7528;method_44393()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 official cLesb;c(Lerw;IIF)Vintermediary method_44389Lnet/minecraft/class_7528;method_44389(Lnet/minecraft/class_332;IIF)Vnamed renderContentsLnet/minecraft/client/gui/widget/ScrollableWidget;renderContents(Lnet/minecraft/client/gui/DrawContext;IIF)V
-