Class AbstractWidget
java.lang.Object
net.minecraft.client.gui.GuiComponent
net.minecraft.client.gui.components.AbstractWidget
- All Implemented Interfaces:
GuiEventListener
,Renderable
,TabOrderedElement
,LayoutElement
,NarratableEntry
,NarrationSupplier
- Direct Known Subclasses:
AbstractButton
,AbstractScrollWidget
,AbstractSliderButton
,AbstractStringWidget
,EditBox
,GameModeSwitcherScreen.GameModeSlot
,ImageWidget
,OverlayRecipeComponent.OverlayRecipeButton
,RecipeButton
,StateSwitchingButton
,TabButton
public abstract class AbstractWidget
extends GuiComponent
implements Renderable, GuiEventListener, LayoutElement, NarratableEntry
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ResourceLocation
boolean
protected float
private boolean
protected int
private long
protected boolean
private Component
private static final double
protected int
private static final double
private int
private Tooltip
private int
static final int
boolean
private boolean
static final ResourceLocation
protected int
private int
private int
Fields inherited from class net.minecraft.client.gui.GuiComponent
BACKGROUND_LOCATION, GUI_ICONS_LOCATION, LIGHT_DIRT_BACKGROUND, STATS_ICON_LOCATION
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
ConstructorDescriptionAbstractWidget
(int p_93629_, int p_93630_, int p_93631_, int p_93632_, Component p_93633_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected boolean
clicked
(double p_93681_, double p_93682_) protected MutableComponent
protected ClientTooltipPositioner
protected void
defaultButtonNarrationText
(NarrationElementOutput p_168803_) int
int
int
int
getWidth()
int
getX()
int
getY()
boolean
isActive()
boolean
boolean
boolean
boolean
isMouseOver
(double p_93672_, double p_93673_) protected boolean
isValidClickButton
(int p_93652_) boolean
mouseClicked
(double p_93641_, double p_93642_, int p_93643_) boolean
mouseDragged
(double p_93645_, double p_93646_, int p_93647_, double p_93648_, double p_93649_) boolean
mouseReleased
(double p_93684_, double p_93685_, int p_93686_) nextFocusPath
(FocusNavigationEvent p_265640_) void
onClick
(double p_93634_, double p_93635_) protected void
onDrag
(double p_93636_, double p_93637_, double p_93638_, double p_93639_) void
onRelease
(double p_93669_, double p_93670_) void
playDownSound
(SoundManager p_93665_) void
protected void
renderScrollingString
(PoseStack p_275527_, Font p_275333_, int p_275661_, int p_275656_) protected static void
renderScrollingString
(PoseStack p_275352_, Font p_275395_, Component p_275742_, int p_275307_, int p_275548_, int p_275592_, int p_275385_, int p_275291_) void
renderTexture
(PoseStack p_268327_, ResourceLocation p_268031_, int p_268218_, int p_267959_, int p_268261_, int p_267978_, int p_267937_, int p_268330_, int p_268160_, int p_267985_, int p_268321_) abstract void
renderWidget
(PoseStack p_268228_, int p_268034_, int p_268009_, float p_268085_) void
setAlpha
(float p_93651_) void
setFGColor
(int color) void
setFocused
(boolean p_93693_) void
setHeight
(int value) void
setMessage
(Component p_93667_) void
setTabOrderGroup
(int p_268123_) void
setTooltip
(Tooltip p_259796_) void
setTooltipDelay
(int p_259732_) void
setWidth
(int p_93675_) void
setX
(int p_254495_) void
setY
(int p_253718_) final void
updateNarration
(NarrationElementOutput p_259921_) private void
protected abstract void
updateWidgetNarration
(NarrationElementOutput p_259858_) void
visitWidgets
(Consumer<AbstractWidget> p_265566_) static MutableComponent
wrapDefaultNarrationMessage
(Component p_168800_) Methods inherited from class net.minecraft.client.gui.GuiComponent
blit, blit, blit, blit, blit, blit, blitNineSliced, blitNineSliced, blitNineSliced, blitOutlineBlack, blitRepeating, disableScissor, drawCenteredString, drawCenteredString, drawCenteredString, drawString, drawString, drawString, enableScissor, fill, fill, fillGradient, fillGradient, fillGradient, hLine, renderOutline, vLine
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
charTyped, getCurrentFocusPath, keyPressed, keyReleased, mouseMoved, mouseScrolled
Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPosition
-
Field Details
-
WIDGETS_LOCATION
-
ACCESSIBILITY_TEXTURE
-
PERIOD_PER_SCROLLED_PIXEL
private static final double PERIOD_PER_SCROLLED_PIXEL- See Also:
-
MIN_SCROLL_PERIOD
private static final double MIN_SCROLL_PERIOD- See Also:
-
width
protected int width -
height
protected int height -
x
private int x -
y
private int y -
message
-
isHovered
protected boolean isHovered -
active
public boolean active -
visible
public boolean visible -
alpha
protected float alpha -
tabOrderGroup
private int tabOrderGroup -
focused
private boolean focused -
tooltip
-
tooltipMsDelay
private int tooltipMsDelay -
hoverOrFocusedStartTime
private long hoverOrFocusedStartTime -
wasHoveredOrFocused
private boolean wasHoveredOrFocused -
UNSET_FG_COLOR
public static final int UNSET_FG_COLOR- See Also:
-
packedFGColor
protected int packedFGColor
-
-
Constructor Details
-
AbstractWidget
-
-
Method Details
-
getHeight
public int getHeight()- Specified by:
getHeight
in interfaceLayoutElement
-
render
- Specified by:
render
in interfaceRenderable
-
updateTooltip
private void updateTooltip() -
createTooltipPositioner
-
setTooltip
-
setTooltipDelay
public void setTooltipDelay(int p_259732_) -
createNarrationMessage
-
wrapDefaultNarrationMessage
-
renderWidget
public abstract void renderWidget(PoseStack p_268228_, int p_268034_, int p_268009_, float p_268085_) -
renderScrollingString
-
renderScrollingString
-
renderTexture
public void renderTexture(PoseStack p_268327_, ResourceLocation p_268031_, int p_268218_, int p_267959_, int p_268261_, int p_267978_, int p_267937_, int p_268330_, int p_268160_, int p_267985_, int p_268321_) -
onClick
public void onClick(double p_93634_, double p_93635_) -
onRelease
public void onRelease(double p_93669_, double p_93670_) -
onDrag
protected void onDrag(double p_93636_, double p_93637_, double p_93638_, double p_93639_) -
mouseClicked
public boolean mouseClicked(double p_93641_, double p_93642_, int p_93643_) - Specified by:
mouseClicked
in interfaceGuiEventListener
-
mouseReleased
public boolean mouseReleased(double p_93684_, double p_93685_, int p_93686_) - Specified by:
mouseReleased
in interfaceGuiEventListener
-
isValidClickButton
protected boolean isValidClickButton(int p_93652_) -
mouseDragged
public boolean mouseDragged(double p_93645_, double p_93646_, int p_93647_, double p_93648_, double p_93649_) - Specified by:
mouseDragged
in interfaceGuiEventListener
-
clicked
protected boolean clicked(double p_93681_, double p_93682_) -
isMouseOver
public boolean isMouseOver(double p_93672_, double p_93673_) - Specified by:
isMouseOver
in interfaceGuiEventListener
-
playDownSound
-
getWidth
public int getWidth()- Specified by:
getWidth
in interfaceLayoutElement
-
setWidth
public void setWidth(int p_93675_) -
setHeight
public void setHeight(int value) -
setAlpha
public void setAlpha(float p_93651_) -
setMessage
-
getMessage
-
isFocused
public boolean isFocused()- Specified by:
isFocused
in interfaceGuiEventListener
-
isHovered
public boolean isHovered() -
isHoveredOrFocused
public boolean isHoveredOrFocused() -
isActive
public boolean isActive()- Specified by:
isActive
in interfaceNarratableEntry
-
setFocused
public void setFocused(boolean p_93693_) - Specified by:
setFocused
in interfaceGuiEventListener
-
getFGColor
public int getFGColor() -
setFGColor
public void setFGColor(int color) -
clearFGColor
public void clearFGColor() -
narrationPriority
- Specified by:
narrationPriority
in interfaceNarratableEntry
-
updateNarration
- Specified by:
updateNarration
in interfaceNarrationSupplier
-
updateWidgetNarration
-
defaultButtonNarrationText
-
getX
public int getX()- Specified by:
getX
in interfaceLayoutElement
-
setX
public void setX(int p_254495_) - Specified by:
setX
in interfaceLayoutElement
-
getY
public int getY()- Specified by:
getY
in interfaceLayoutElement
-
setY
public void setY(int p_253718_) - Specified by:
setY
in interfaceLayoutElement
-
visitWidgets
- Specified by:
visitWidgets
in interfaceLayoutElement
-
getRectangle
- Specified by:
getRectangle
in interfaceGuiEventListener
- Specified by:
getRectangle
in interfaceLayoutElement
-
getTabOrderGroup
public int getTabOrderGroup()- Specified by:
getTabOrderGroup
in interfaceTabOrderedElement
-
setTabOrderGroup
public void setTabOrderGroup(int p_268123_)
-