java.lang.Object
me.despical.inventoryframework.pane.Pane
me.despical.inventoryframework.pane.component.CycleButton

public class CycleButton extends Pane
A button for cycling between different options
Since:
1.0.1

Created at 04.09.2020

Author:
Despical
  • Constructor Details

    • CycleButton

      public CycleButton(int x, int y, int length, int height, @NotNull @NotNull Pane.Priority priority)
    • CycleButton

      public CycleButton(int x, int y, int length, int height)
    • CycleButton

      public CycleButton(int length, int height)
  • Method Details

    • load

      @NotNull public static @NotNull CycleButton load(@NotNull @NotNull Object instance, @NotNull @NotNull Element element)
      Loads a cycle button from a given element
      Parameters:
      instance - the instance class
      element - the element
      Returns:
      the cycle button
      Since:
      1.0.1
    • click

      public boolean click(@NotNull @NotNull Gui gui, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent event, int paneOffsetX, int paneOffsetY, int maxLength, int maxHeight)
      Description copied from class: Pane
      Called whenever there is being clicked on this pane
      Specified by:
      click in class Pane
      Parameters:
      gui - the gui this event stems from
      event - the event that occurred while clicking on this item
      paneOffsetX - the pane's offset on the x axis
      paneOffsetY - the pane's offset on the y axis
      maxLength - the maximum length of the pane
      maxHeight - the maximum height of the pane
      Returns:
      whether the item was found or not
    • display

      public void display(@NotNull @NotNull Gui gui, @NotNull @NotNull org.bukkit.inventory.Inventory inventory, @NotNull @NotNull org.bukkit.inventory.PlayerInventory playerInventory, int paneOffsetX, int paneOffsetY, int maxLength, int maxHeight)
      Description copied from class: Pane
      Has to set all the items in the right spot inside the inventory
      Specified by:
      display in class Pane
      Parameters:
      gui - the gui for which we're rendering
      inventory - the inventory that the items should be displayed in
      playerInventory - the player's inventory
      paneOffsetX - the pane's offset on the x axis
      paneOffsetY - the pane's offset on the y axis
      maxLength - the maximum length of the pane
      maxHeight - the maximum height of the pane
    • getItems

      @NotNull public @NotNull Collection<GuiItem> getItems()
      Description copied from class: Pane
      Gets all the items in this pane and all underlying panes. The returned collection is not guaranteed to be mutable or to be a view of the underlying data. (So changes to the gui are not guaranteed to be visible in the returned value.)
      Specified by:
      getItems in class Pane
      Returns:
      all items
    • addPane

      public void addPane(int index, @NotNull @NotNull Pane pane)
      Adds a pane to the current list of options
      Parameters:
      index - the index to insert the pane at
      pane - the pane to add
      Since:
      1.0.1
    • addPane

      public void addPane(@NotNull @NotNull Pane pane)
      Adds a pane to the current list of options
      Parameters:
      pane - the pane to add
      Since:
      1.0.1
    • clear

      public void clear()
      Description copied from class: Pane
      Clears the entire pane of any items/panes. Underlying panes will not be cleared.
      Specified by:
      clear in class Pane
    • getPanes

      @NotNull public @NotNull Collection<Pane> getPanes()
      Description copied from class: Pane
      Gets all the panes in this panes, including any child panes from other panes. The returned collection is not guaranteed to be mutable or to be a view of the underlying data. (So changes to the gui are not guaranteed to be visible in the returned value.)
      Specified by:
      getPanes in class Pane
      Returns:
      all panes
    • cycle

      public void cycle()
      Cycles through one option, making it go to the next one
      Since:
      1.0.1