Class AbstractContainerWidget
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractContainerWidget
- All Implemented Interfaces:
ContainerEventHandler,GuiEventListener,Renderable,TabOrderedElement,LayoutElement,NarratableEntry,NarrationSupplier,IAbstractWidgetExtension
- Direct Known Subclasses:
AbstractSelectionList,ConfigurationScreen.ConfigurationListScreen.ListLabelWidget
public abstract class AbstractContainerWidget
extends AbstractWidget
implements ContainerEventHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsFields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
ConstructorsConstructorDescriptionAbstractContainerWidget(int p_313730_, int p_313819_, int p_313847_, int p_313718_, Component p_313894_) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanbooleanbooleanmouseClicked(double p_313764_, double p_313832_, int p_313688_) Called when a mouse button is clicked within the GUI element.booleanmouseDragged(double p_313749_, double p_313887_, int p_313839_, double p_313844_, double p_313686_) Called when the mouse is dragged within the GUI element.booleanmouseReleased(double p_313886_, double p_313935_, int p_313751_) Called when a mouse button is released within the GUI element.nextFocusPath(FocusNavigationEvent p_313949_) Retrieves the next focus path based on the given focus navigation event.final voidsetDragging(boolean p_313698_) Sets if the GUI element is dragging or not.voidsetFocused(boolean p_313936_) Sets the focus state of the GUI element.voidsetFocused(GuiEventListener p_313725_) Sets the focus state of the GUI element.Methods inherited from class net.minecraft.client.gui.components.AbstractWidget
clearFGColor, clicked, createNarrationMessage, defaultButtonNarrationText, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, narrationPriority, onClick, onDrag, onRelease, playDownSound, render, renderScrollingString, renderScrollingString, renderScrollingString, renderWidget, setAlpha, setFGColor, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, updateWidgetNarration, visitWidgets, wrapDefaultNarrationMessageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, children, getChildAt, getCurrentFocusPath, keyPressed, keyReleased, mouseScrolledMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getRectangle, isMouseOver, mouseMovedMethods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension
onClickMethods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPositionMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
focused
-
isDragging
private boolean isDragging
-
-
Constructor Details
-
AbstractContainerWidget
public AbstractContainerWidget(int p_313730_, int p_313819_, int p_313847_, int p_313718_, Component p_313894_)
-
-
Method Details
-
isDragging
public final boolean isDragging()- Specified by:
isDraggingin interfaceContainerEventHandler
-
setDragging
public final void setDragging(boolean p_313698_) Description copied from interface:ContainerEventHandlerSets if the GUI element is dragging or not.- Specified by:
setDraggingin interfaceContainerEventHandler- Parameters:
p_313698_- the dragging state of the GUI element.
-
getFocused
- Specified by:
getFocusedin interfaceContainerEventHandler
-
setFocused
Description copied from interface:ContainerEventHandlerSets the focus state of the GUI element.- Specified by:
setFocusedin interfaceContainerEventHandler- Parameters:
p_313725_- the focused GUI element.
-
mouseClicked
public boolean mouseClicked(double p_313764_, double p_313832_, int p_313688_) Description copied from class:AbstractWidgetCalled when a mouse button is clicked within the GUI element.- Specified by:
mouseClickedin interfaceContainerEventHandler- Specified by:
mouseClickedin interfaceGuiEventListener- Overrides:
mouseClickedin classAbstractWidget- Parameters:
p_313764_- the X coordinate of the mouse.p_313832_- the Y coordinate of the mouse.p_313688_- the button that was clicked.- Returns:
trueif the event is consumed,falseotherwise.
-
mouseReleased
public boolean mouseReleased(double p_313886_, double p_313935_, int p_313751_) Description copied from class:AbstractWidgetCalled when a mouse button is released within the GUI element.- Specified by:
mouseReleasedin interfaceContainerEventHandler- Specified by:
mouseReleasedin interfaceGuiEventListener- Overrides:
mouseReleasedin classAbstractWidget- Parameters:
p_313886_- the X coordinate of the mouse.p_313935_- the Y coordinate of the mouse.p_313751_- the button that was released.- Returns:
trueif the event is consumed,falseotherwise.
-
mouseDragged
public boolean mouseDragged(double p_313749_, double p_313887_, int p_313839_, double p_313844_, double p_313686_) Description copied from class:AbstractWidgetCalled when the mouse is dragged within the GUI element.- Specified by:
mouseDraggedin interfaceContainerEventHandler- Specified by:
mouseDraggedin interfaceGuiEventListener- Overrides:
mouseDraggedin classAbstractWidget- Parameters:
p_313749_- the X coordinate of the mouse.p_313887_- the Y coordinate of the mouse.p_313839_- the button that is being dragged.p_313844_- the X distance of the drag.p_313686_- the Y distance of the drag.- Returns:
trueif the event is consumed,falseotherwise.
-
isFocused
public boolean isFocused()- Specified by:
isFocusedin interfaceContainerEventHandler- Specified by:
isFocusedin interfaceGuiEventListener- Overrides:
isFocusedin classAbstractWidget
-
setFocused
public void setFocused(boolean p_313936_) Description copied from class:AbstractWidgetSets the focus state of the GUI element.- Specified by:
setFocusedin interfaceContainerEventHandler- Specified by:
setFocusedin interfaceGuiEventListener- Overrides:
setFocusedin classAbstractWidget- Parameters:
p_313936_-trueto apply focus,falseto remove focus
-