Class AbstractSelectionList<E extends AbstractSelectionList.Entry<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
  • Field Details

  • Constructor Details

    • AbstractSelectionList

      public AbstractSelectionList(Minecraft minecraft, int width, int height, int y, int defaultEntryHeight)
  • Method Details

    • getSelected

      public @Nullable E getSelected()
    • setSelected

      public void setSelected(@Nullable E selected)
    • getFocused

      public @Nullable E getFocused()
      Specified by:
      getFocused in interface ContainerEventHandler
      Overrides:
      getFocused in class AbstractContainerWidget
    • children

      public final List<E> children()
    • sort

      protected void sort(Comparator<E> comparator)
    • swap

      protected void swap(int firstIndex, int secondIndex)
    • clearEntries

      public void clearEntries()
    • clearEntriesExcept

      protected void clearEntriesExcept(E exception)
    • replaceEntries

      public void replaceEntries(Collection<E> newChildren)
    • getFirstEntryY

      private int getFirstEntryY()
    • getNextY

      public int getNextY()
    • addEntry

      protected int addEntry(E entry)
    • addEntry

      protected int addEntry(E entry, int height)
    • addEntryToTop

      protected void addEntryToTop(E entry)
    • addEntryToTop

      protected void addEntryToTop(E entry, int height)
    • repositionEntries

      private void repositionEntries()
    • removeEntryFromTop

      protected void removeEntryFromTop(E entry)
    • getItemCount

      protected int getItemCount()
    • entriesCanBeSelected

      protected boolean entriesCanBeSelected()
    • getEntryAtPosition

      protected final @Nullable E getEntryAtPosition(double posX, double posY)
    • updateSize

      public void updateSize(int width, HeaderAndFooterLayout layout)
    • 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:
      contentHeight in class AbstractScrollArea
    • renderWidget

      public void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float a)
      Specified by:
      renderWidget in class AbstractWidget
    • renderListSeparators

      protected void renderListSeparators(GuiGraphics graphics)
    • renderListBackground

      protected void renderListBackground(GuiGraphics graphics)
    • enableScissor

      protected void enableScissor(GuiGraphics graphics)
    • scrollToEntry

      protected void scrollToEntry(E entry)
    • centerScrollOn

      protected void centerScrollOn(E entry)
    • scroll

      private void scroll(int amount)
    • setScrollAmount

      public void setScrollAmount(double scrollAmount)
      Overrides:
      setScrollAmount in class AbstractScrollArea
    • scrollBarX

      protected int scrollBarX()
      Overrides:
      scrollBarX in class AbstractScrollArea
    • getChildAt

      public Optional<GuiEventListener> getChildAt(double x, double y)
      Description copied from interface: ContainerEventHandler
      Returns the first event listener that intersects with the mouse coordinates.
    • setFocused

      public void setFocused(@Nullable GuiEventListener focused)
      Description copied from interface: ContainerEventHandler
      Sets the focus state of the GUI element.
      Specified by:
      setFocused in interface ContainerEventHandler
      Overrides:
      setFocused in class AbstractContainerWidget
      Parameters:
      focused - the focused GUI element.
    • nextEntry

      protected @Nullable E nextEntry(ScreenDirection dir)
    • nextEntry

      protected @Nullable E nextEntry(ScreenDirection dir, Predicate<E> canSelect)
    • nextEntry

      protected @Nullable E nextEntry(ScreenDirection dir, Predicate<E> canSelect, @Nullable E startEntry)
    • renderListItems

      protected void renderListItems(GuiGraphics graphics, int mouseX, int mouseY, float a)
    • renderItem

      protected void renderItem(GuiGraphics graphics, int mouseX, int mouseY, float a, E entry)
    • renderSelection

      protected void renderSelection(GuiGraphics graphics, E entry, int outlineColor)
    • 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

      public NarratableEntry.NarrationPriority narrationPriority()
      Specified by:
      narrationPriority in interface NarratableEntry
      Overrides:
      narrationPriority in class AbstractWidget
    • removeEntries

      protected void removeEntries(List<E> entries)
    • removeEntry

      protected void removeEntry(E entry)
    • getHovered

      protected @Nullable E getHovered()
    • bindEntryToSelf

      private void bindEntryToSelf(AbstractSelectionList.Entry<E> entry)
    • narrateListElementPosition

      protected void narrateListElementPosition(NarrationElementOutput output, E element)