Class TabNavigationBar
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractScrollArea
net.minecraft.client.gui.components.AbstractContainerWidget
net.minecraft.client.gui.components.tabs.TabNavigationBar
- All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier
- Direct Known Subclasses:
MenuTabBar
public class TabNavigationBar
extends AbstractContainerWidget
implements NarratableEntry, Renderable
-
Nested Class Summary
Nested ClassesNested 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
FieldsModifier and TypeFieldDescriptionprotected final FrameLayoutprivate static final intprotected final ImmutableList<TabButton> private final TabManagerprotected final ImmutableList<Tab> private static final ComponentFields inherited from class AbstractScrollArea
SCROLLBAR_WIDTHFields inherited from class AbstractWidget
active, alpha, height, isHovered, message, packedFGColor, UNSET_FG_COLOR, visible, width -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTabNavigationBar(int x, int y, int width, int height, TabManager tabManager, ImmutableList<TabButton> tabButtons, ImmutableList<Tab> tabs) -
Method Summary
Modifier and TypeMethodDescriptionvoidarrangeElements(int width) static TabNavigationBar.Builderbuilder(TabManager tabManager, int x, int y, int width, int height) List<? extends GuiEventListener> children()protected intprivate intprotected voidextractWidgetRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) private intgetNextTabIndex(int currentTab, KeyEvent event) private intgetNextTabIndex(KeyEvent event) getTabs()booleanisMouseOver(double mouseX, double mouseY) booleankeyPressed(KeyEvent event) protected voidnarrateListElementPosition(NarrationElementOutput output, TabButton widget) nextFocusPath(FocusNavigationEvent navigationEvent) voidselectTab(int index, boolean playSound) voidsetFocused(boolean focused) voidsetFocused(@Nullable GuiEventListener focused) voidsetTabActiveState(int index, boolean active) voidsetTabTooltip(int index, @Nullable Tooltip hint) protected voidMethods inherited from class AbstractContainerWidget
getFocused, isDragging, isFocused, mouseClicked, mouseDragged, mouseReleased, setDraggingMethods inherited from class AbstractScrollArea
defaultSettings, extractScrollbar, isOverScrollbar, maxScrollAmount, mouseScrolled, onRelease, refreshScrollAmount, scrollable, scrollAmount, scrollbarWidth, scrollBarX, scrollBarY, scrollerHeight, scrollRate, setScrollAmount, updateScrollingMethods inherited from class AbstractWidget
clearFGColor, createNarrationMessage, defaultButtonNarrationText, extractRenderState, extractScrollingStringOverContents, extractTooltipForNextRenderPass, getAlpha, getBottom, getFGColor, getHeight, getMessage, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isActive, isHovered, isHoveredOrFocused, isValidClickButton, onClick, onDrag, playButtonClickSound, playDownSound, setAlpha, setFGColor, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessageMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContainerEventHandler
charTyped, getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, keyReleased, mouseScrolled, preeditUpdatedMethods inherited from interface GuiEventListener
mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface LayoutElement
setPositionMethods inherited from interface NarratableEntry
getNarratables, isActiveMethods inherited from interface NarrationSupplier
updateNarrationMethods inherited from interface Renderable
extractRenderStateMethods inherited from interface TabOrderedElement
getTabOrderGroup
-
Field Details
-
NO_TAB
private static final int NO_TAB- See Also:
-
USAGE_NARRATION
-
layout
-
tabManager
-
tabs
-
tabButtons
-
-
Constructor Details
-
TabNavigationBar
protected TabNavigationBar(int x, int y, int width, int height, TabManager tabManager, ImmutableList<TabButton> tabButtons, ImmutableList<Tab> tabs)
-
-
Method Details
-
contentHeight
protected int contentHeight()- Specified by:
contentHeightin classAbstractScrollArea
-
builder
public static TabNavigationBar.Builder builder(TabManager tabManager, int x, int y, int width, int height) -
arrangeElements
public void arrangeElements(int width) -
isMouseOver
public boolean isMouseOver(double mouseX, double mouseY) - Specified by:
isMouseOverin interfaceGuiEventListener- Overrides:
isMouseOverin classAbstractWidget
-
setFocused
public void setFocused(boolean focused) - Specified by:
setFocusedin interfaceContainerEventHandler- Specified by:
setFocusedin interfaceGuiEventListener- Overrides:
setFocusedin classAbstractContainerWidget
-
setFocused
- Specified by:
setFocusedin interfaceContainerEventHandler- Overrides:
setFocusedin classAbstractContainerWidget
-
children
- Specified by:
childrenin interfaceContainerEventHandler
-
getTabs
-
narrationPriority
- Specified by:
narrationPriorityin interfaceNarratableEntry- Overrides:
narrationPriorityin classAbstractWidget
-
updateWidgetNarration
- Specified by:
updateWidgetNarrationin classAbstractWidget
-
narrateListElementPosition
-
extractWidgetRenderState
protected void extractWidgetRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) - Specified by:
extractWidgetRenderStatein classAbstractWidget
-
getRectangle
- Specified by:
getRectanglein interfaceGuiEventListener- Specified by:
getRectanglein interfaceLayoutElement- Overrides:
getRectanglein classAbstractWidget
-
selectTab
public void selectTab(int index, boolean playSound) -
setTabActiveState
public void setTabActiveState(int index, boolean active) -
setTabTooltip
-
keyPressed
- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener
-
getNextTabIndex
-
getNextTabIndex
-
currentTabIndex
private int currentTabIndex() -
currentTabButton
-