Class AbstractSelectionList<E extends AbstractSelectionList.Entry<E>>
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.AbstractSelectionList<E>
- All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier
- Direct Known Subclasses:
ContainerObjectSelectionList, ObjectSelectionList
public abstract class AbstractSelectionList<E extends AbstractSelectionList.Entry<E>>
extends AbstractContainerWidget
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprivate classNested 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 booleanprotected final intprivate @Nullable Eprivate static final Identifierprivate static final Identifierprotected final Minecraftprivate @Nullable Eprivate static final intFields inherited from class AbstractScrollArea
SCROLLBAR_WIDTHFields inherited from class AbstractWidget
active, alpha, height, isHovered, message, packedFGColor, UNSET_FG_COLOR, visible, width -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSelectionList(Minecraft minecraft, int width, int height, int y, int defaultEntryHeight) -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected intprotected voidaddEntryToTop(E entry) protected voidaddEntryToTop(E entry, int height) private voidprotected voidcenterScrollOn(E entry) children()voidprotected voidclearEntriesExcept(E exception) protected intprotected voidenableScissor(GuiGraphics graphics) protected booleangetChildAt(double x, double y) Returns the first event listener that intersects with the mouse coordinates.protected final @Nullable EgetEntryAtPosition(double posX, double posY) private int@Nullable Eprotected @Nullable Eprotected intintgetNextY()intgetRowBottom(int row) intintintgetRowTop(int row) int@Nullable Eprotected voidnarrateListElementPosition(NarrationElementOutput output, E element) protected @Nullable EnextEntry(ScreenDirection dir) protected @Nullable EnextEntry(ScreenDirection dir, Predicate<E> canSelect) protected @Nullable EnextEntry(ScreenDirection dir, Predicate<E> canSelect, @Nullable E startEntry) protected voidremoveEntries(List<E> entries) protected voidremoveEntry(E entry) protected voidremoveEntryFromTop(E entry) protected voidrenderItem(GuiGraphics graphics, int mouseX, int mouseY, float a, E entry) protected voidrenderListBackground(GuiGraphics graphics) protected voidrenderListItems(GuiGraphics graphics, int mouseX, int mouseY, float a) protected voidrenderListSeparators(GuiGraphics graphics) protected voidrenderSelection(GuiGraphics graphics, E entry, int outlineColor) voidrenderWidget(GuiGraphics graphics, int mouseX, int mouseY, float a) voidreplaceEntries(Collection<E> newChildren) private voidprivate voidscroll(int amount) protected intprotected voidscrollToEntry(E entry) voidsetFocused(@Nullable GuiEventListener focused) Sets the focus state of the GUI element.voidsetScrollAmount(double scrollAmount) voidsetSelected(@Nullable E selected) protected voidsort(Comparator<E> comparator) protected voidswap(int firstIndex, int secondIndex) voidupdateSize(int width, HeaderAndFooterLayout layout) voidupdateSizeAndPosition(int width, int height, int y) voidupdateSizeAndPosition(int width, int height, int x, int y) Methods inherited from class AbstractContainerWidget
isDragging, isFocused, mouseClicked, mouseDragged, mouseReleased, nextFocusPath, setDragging, setFocusedMethods inherited from class AbstractScrollArea
defaultSettings, isOverScrollbar, maxScrollAmount, mouseScrolled, onRelease, refreshScrollAmount, renderScrollbar, scrollable, scrollAmount, scrollbarWidth, scrollBarY, scrollerHeight, scrollRate, 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, onClick, onDrag, playButtonClickSound, playDownSound, render, renderScrollingStringOverContents, 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, getBorderForArrowNavigation, 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
-
MENU_LIST_BACKGROUND
-
INWORLD_MENU_LIST_BACKGROUND
-
SEPARATOR_HEIGHT
private static final int SEPARATOR_HEIGHT- See Also:
-
minecraft
-
defaultEntryHeight
protected final int defaultEntryHeight -
children
-
centerListVertically
protected boolean centerListVertically -
selected
-
hovered
-
-
Constructor Details
-
AbstractSelectionList
public AbstractSelectionList(Minecraft minecraft, int width, int height, int y, int defaultEntryHeight)
-
-
Method Details
-
getSelected
-
setSelected
-
getFocused
- Specified by:
getFocusedin interfaceContainerEventHandler- Overrides:
getFocusedin classAbstractContainerWidget
-
children
-
sort
-
swap
protected void swap(int firstIndex, int secondIndex) -
clearEntries
public void clearEntries() -
clearEntriesExcept
-
replaceEntries
-
getFirstEntryY
private int getFirstEntryY() -
getNextY
public int getNextY() -
addEntry
-
addEntry
-
addEntryToTop
-
addEntryToTop
-
repositionEntries
private void repositionEntries() -
removeEntryFromTop
-
getItemCount
protected int getItemCount() -
entriesCanBeSelected
protected boolean entriesCanBeSelected() -
getEntryAtPosition
-
updateSizeAndPosition
public void updateSizeAndPosition(int width, int height, int y) -
updateSizeAndPosition
public void updateSizeAndPosition(int width, int height, int x, int y) -
contentHeight
protected int contentHeight()- Specified by:
contentHeightin classAbstractScrollArea
-
renderWidget
- Specified by:
renderWidgetin classAbstractWidget
-
renderListSeparators
-
renderListBackground
-
enableScissor
-
scrollToEntry
-
centerScrollOn
-
scroll
private void scroll(int amount) -
setScrollAmount
public void setScrollAmount(double scrollAmount) - Overrides:
setScrollAmountin classAbstractScrollArea
-
scrollBarX
protected int scrollBarX()- Overrides:
scrollBarXin classAbstractScrollArea
-
getChildAt
Description copied from interface:ContainerEventHandlerReturns the first event listener that intersects with the mouse coordinates. -
setFocused
Description copied from interface:ContainerEventHandlerSets the focus state of the GUI element.- Specified by:
setFocusedin interfaceContainerEventHandler- Overrides:
setFocusedin classAbstractContainerWidget- Parameters:
focused- the focused GUI element.
-
renderListItems
-
renderItem
-
renderSelection
-
getRowLeft
public int getRowLeft() -
getRowRight
public int getRowRight() -
getRowTop
public int getRowTop(int row) -
getRowBottom
public int getRowBottom(int row) -
getRowWidth
public int getRowWidth() -
narrationPriority
- Specified by:
narrationPriorityin interfaceNarratableEntry- Overrides:
narrationPriorityin classAbstractWidget
-
removeEntries
-
removeEntry
-
getHovered
-
bindEntryToSelf
-
narrateListElementPosition
-