Class AbstractContainerWidget
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractScrollArea
net.minecraft.client.gui.components.AbstractContainerWidget
- All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier
- Direct Known Subclasses:
AbstractSelectionList, ConfigurationScreen.ConfigurationListScreen.ListLabelWidget, ScrollableLayout.Container
public abstract class AbstractContainerWidget
extends AbstractScrollArea
implements ContainerEventHandler
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractScrollArea
AbstractScrollArea.ScrollbarSettingsNested classes/interfaces inherited from class AbstractWidget
AbstractWidget.WithInactiveMessageNested classes/interfaces inherited from interface NarratableEntry
NarratableEntry.NarrationPriority -
Field Summary
FieldsFields inherited from class AbstractScrollArea
SCROLLBAR_WIDTHFields inherited from class AbstractWidget
active, alpha, height, isHovered, message, packedFGColor, UNSET_FG_COLOR, visible, width -
Constructor Summary
ConstructorsConstructorDescriptionAbstractContainerWidget(int x, int y, int width, int height, Component message, AbstractScrollArea.ScrollbarSettings scrollbarSettings) -
Method Summary
Modifier and TypeMethodDescription@Nullable GuiEventListenerfinal booleanbooleanbooleanmouseClicked(MouseButtonEvent event, boolean doubleClick) booleanmouseDragged(MouseButtonEvent event, double dx, double dy) booleanmouseReleased(MouseButtonEvent event) @Nullable ComponentPathnextFocusPath(FocusNavigationEvent navigationEvent) Retrieves the next focus path based on the given focus navigation event.final voidsetDragging(boolean dragging) Sets if the GUI element is dragging or not.voidsetFocused(boolean focused) Sets the focus state of the GUI element.voidsetFocused(@Nullable GuiEventListener focused) Sets the focus state of the GUI element.Methods inherited from class AbstractScrollArea
contentHeight, defaultSettings, isOverScrollbar, maxScrollAmount, mouseScrolled, onRelease, refreshScrollAmount, renderScrollbar, scrollable, scrollAmount, scrollbarWidth, scrollBarX, scrollBarY, scrollerHeight, scrollRate, setScrollAmount, updateScrollingMethods inherited from class AbstractWidget
clearFGColor, createNarrationMessage, defaultButtonNarrationText, getAlpha, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isActive, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, narrationPriority, onClick, onDrag, playButtonClickSound, playDownSound, render, renderScrollingStringOverContents, renderWidget, setAlpha, setFGColor, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, updateWidgetNarration, visitWidgets, wrapDefaultNarrationMessageMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContainerEventHandler
charTyped, children, getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, keyPressed, keyReleased, mouseScrolledMethods inherited from interface GuiEventListener
getRectangle, isMouseOver, mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface LayoutElement
setPositionMethods inherited from interface NarratableEntry
getNarratablesMethods inherited from interface TabOrderedElement
getTabOrderGroup
-
Field Details
-
focused
-
isDragging
private boolean isDragging
-
-
Constructor Details
-
AbstractContainerWidget
public AbstractContainerWidget(int x, int y, int width, int height, Component message, AbstractScrollArea.ScrollbarSettings scrollbarSettings)
-
-
Method Details
-
isDragging
public final boolean isDragging()- Specified by:
isDraggingin interfaceContainerEventHandler
-
setDragging
public final void setDragging(boolean dragging) Description copied from interface:ContainerEventHandlerSets if the GUI element is dragging or not.- Specified by:
setDraggingin interfaceContainerEventHandler- Parameters:
dragging- 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:
focused- the focused GUI element.
-
mouseClicked
- Specified by:
mouseClickedin interfaceContainerEventHandler- Specified by:
mouseClickedin interfaceGuiEventListener- Overrides:
mouseClickedin classAbstractWidget
-
mouseReleased
- Specified by:
mouseReleasedin interfaceContainerEventHandler- Specified by:
mouseReleasedin interfaceGuiEventListener- Overrides:
mouseReleasedin classAbstractWidget
-
mouseDragged
- Specified by:
mouseDraggedin interfaceContainerEventHandler- Specified by:
mouseDraggedin interfaceGuiEventListener- Overrides:
mouseDraggedin classAbstractScrollArea
-
isFocused
public boolean isFocused()- Specified by:
isFocusedin interfaceContainerEventHandler- Specified by:
isFocusedin interfaceGuiEventListener- Overrides:
isFocusedin classAbstractWidget
-
setFocused
public void setFocused(boolean focused) Description copied from interface:GuiEventListenerSets the focus state of the GUI element.- Specified by:
setFocusedin interfaceContainerEventHandler- Specified by:
setFocusedin interfaceGuiEventListener- Overrides:
setFocusedin classAbstractWidget- Parameters:
focused-trueto apply focus,falseto remove focus
-