Class SimplePaginationLayout

java.lang.Object
com.kamikazejam.kamicommon.menu.api.struct.paginated.layout.SimplePaginationLayout
All Implemented Interfaces:
PaginationLayout

public class SimplePaginationLayout extends Object implements PaginationLayout
Represents the simplest layout for a PaginatedMenu.
This layout is defined by:
  • A 1 block gap (border) at the top of the menu where no items are placed.
  • A 1 block gap (border) at the left and right of the menu where no items are placed.
  • The last row is reserved for the pagination controls.
  • The second to last row is also a gap (border) row, such that the remaining rows in between are used for the page items.
NOTE: This layout only supports menu sizes that have at least 4 rows. (and only works properly on 9-column menus)
  • Constructor Details

    • SimplePaginationLayout

      public SimplePaginationLayout()
  • Method Details

    • getSlots

      @NotNull public @NotNull Collection<Integer> getSlots(@NotNull @NotNull MenuSize size)
      Description copied from interface: PaginationLayout
      Get the slots of the menu that are used for the pages. Will use the ordering of the collection to place slots.
      Any slots that do not fall within the confines of the menu will be ignored.
      Specified by:
      getSlots in interface PaginationLayout
      Parameters:
      size - The MenuSize for generating an appropriate range of slots.
      Returns:
      The slots of the menu to place page items into.
    • getNextIconSlot

      @NotNull public @NotNull IconSlot getNextIconSlot(@NotNull @NotNull MenuSize size)
      Description copied from interface: PaginationLayout
      Get the slot that the next icon (if needed) will be placed into.
      If this slot is invalid (outside the menu), the icon will not be placed.
      Specified by:
      getNextIconSlot in interface PaginationLayout
    • getPrevIconSlot

      @NotNull public @NotNull IconSlot getPrevIconSlot(@NotNull @NotNull MenuSize size)
      Description copied from interface: PaginationLayout
      Get the slot that the previous icon (if needed) will be placed into.
      If this slot is invalid (outside the menu), the icon will not be placed.
      Specified by:
      getPrevIconSlot in interface PaginationLayout
    • copy

      @NotNull public @NotNull PaginationLayout copy()
      Specified by:
      copy in interface PaginationLayout