Class AbstractSelectionList<E extends AbstractSelectionList.Entry<E>>

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement, LayoutElement, NarratableEntry, NarrationSupplier, IAbstractWidgetExtension
Direct Known Subclasses:
ContainerObjectSelectionList, ObjectSelectionList

public abstract class AbstractSelectionList<E extends AbstractSelectionList.Entry<E>> extends AbstractContainerWidget
  • Field Details

  • Constructor Details

    • AbstractSelectionList

      public AbstractSelectionList(Minecraft pMinecraft, int pWidth, int pHeight, int pY, int pItemHeight)
    • AbstractSelectionList

      public AbstractSelectionList(Minecraft pMinecraft, int pWidth, int pHeight, int pY, int pItemHeight, int pHeaderHeight)
  • Method Details

    • getSelected

      @Nullable public E getSelected()
    • setSelectedIndex

      public void setSelectedIndex(int pSelected)
    • setSelected

      public void setSelected(@Nullable E pSelected)
    • getFirstElement

      public E getFirstElement()
    • getFocused

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

      public final List<E> children()
    • clearEntries

      protected void clearEntries()
    • replaceEntries

      public void replaceEntries(Collection<E> pEntries)
    • getEntry

      protected E getEntry(int pIndex)
    • addEntry

      protected int addEntry(E pEntry)
    • addEntryToTop

      protected void addEntryToTop(E pEntry)
    • removeEntryFromTop

      protected boolean removeEntryFromTop(E pEntry)
    • getItemCount

      protected int getItemCount()
    • isSelectedItem

      protected boolean isSelectedItem(int pIndex)
    • getEntryAtPosition

      @Nullable protected final E getEntryAtPosition(double pMouseX, double pMouseY)
    • updateSize

      public void updateSize(int pWidth, HeaderAndFooterLayout pLayout)
    • updateSizeAndPosition

      public void updateSizeAndPosition(int pWidth, int pHeight, int pY)
    • contentHeight

      protected int contentHeight()
      Specified by:
      contentHeight in class AbstractScrollArea
    • renderHeader

      protected void renderHeader(GuiGraphics pGuiGraphics, int pX, int pY)
    • renderDecorations

      protected void renderDecorations(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY)
    • renderWidget

      public void renderWidget(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Specified by:
      renderWidget in class AbstractWidget
    • renderListSeparators

      protected void renderListSeparators(GuiGraphics pGuiGraphics)
    • renderListBackground

      protected void renderListBackground(GuiGraphics pGuiGraphics)
    • enableScissor

      protected void enableScissor(GuiGraphics pGuiGraphics)
    • centerScrollOn

      protected void centerScrollOn(E pEntry)
    • ensureVisible

      protected void ensureVisible(E pEntry)
    • scroll

      private void scroll(int pScroll)
    • scrollRate

      protected double scrollRate()
      Specified by:
      scrollRate in class AbstractScrollArea
    • scrollBarX

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

      public Optional<GuiEventListener> getChildAt(double pMouseX, double pMouseY)
      Returns the first event listener that intersects with the mouse coordinates.
    • setFocused

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

      @Nullable protected E nextEntry(ScreenDirection pDirection)
    • nextEntry

      @Nullable protected E nextEntry(ScreenDirection pDirection, Predicate<E> pPredicate)
    • nextEntry

      @Nullable protected E nextEntry(ScreenDirection pDirection, Predicate<E> pPredicate, @Nullable E pSelected)
    • renderListItems

      protected void renderListItems(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
    • renderItem

      protected void renderItem(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick, int pIndex, int pLeft, int pTop, int pWidth, int pHeight)
    • renderSelection

      protected void renderSelection(GuiGraphics pGuiGraphics, int pTop, int pWidth, int pHeight, int pOuterColor, int pInnerColor)
    • getRowLeft

      public int getRowLeft()
    • getRowRight

      public int getRowRight()
    • getRowTop

      public int getRowTop(int pIndex)
    • getRowBottom

      public int getRowBottom(int pIndex)
    • getRowWidth

      public int getRowWidth()
    • narrationPriority

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

      @Nullable protected E remove(int pIndex)
    • removeEntry

      protected boolean removeEntry(E pEntry)
    • getHovered

      @Nullable protected E getHovered()
    • bindEntryToSelf

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

      protected void narrateListElementPosition(NarrationElementOutput pNarrationElementOutput, E pEntry)