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(GuiGraphicsExtractor graphics) protected booleanprotected voidextractItem(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a, E entry) protected voidextractListBackground(GuiGraphicsExtractor graphics) protected voidextractListItems(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) protected voidextractListSeparators(GuiGraphicsExtractor graphics) protected voidextractSelection(GuiGraphicsExtractor graphics, E entry, int outlineColor) voidextractWidgetRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) getChildAt(double x, double y) 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) voidreplaceEntries(Collection<E> newChildren) private voidprivate voidscroll(int amount) protected intprotected voidscrollToEntry(E entry) voidsetFocused(@Nullable GuiEventListener focused) 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, extractScrollbar, isOverScrollbar, maxScrollAmount, mouseScrolled, onRelease, refreshScrollAmount, scrollable, scrollAmount, scrollbarWidth, scrollBarY, scrollerHeight, scrollRate, updateScrollingMethods inherited from class AbstractWidget
clearFGColor, createNarrationMessage, defaultButtonNarrationText, extractRenderState, extractScrollingStringOverContents, getAlpha, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isActive, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, onClick, onDrag, playButtonClickSound, playDownSound, 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, mouseScrolled, preeditUpdatedMethods 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
-
extractWidgetRenderState
public void extractWidgetRenderState(GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a) - Specified by:
extractWidgetRenderStatein classAbstractWidget
-
extractListSeparators
-
extractListBackground
-
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
-
setFocused
- Specified by:
setFocusedin interfaceContainerEventHandler- Overrides:
setFocusedin classAbstractContainerWidget
-
extractListItems
-
extractItem
-
extractSelection
-
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
-