All Implemented Interfaces:
Flippable, Orientable

public class Slider extends VariableBar
A slider for a graphical interface into what amount of a whole is set.
Since:
0.5.0

Created at 04.09.2020

Author:
Despical
  • Constructor Details

    • Slider

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

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

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

    • load

      @NotNull @Contract(pure=true) public static @NotNull Slider load(@NotNull @NotNull Object instance, @NotNull @NotNull Element element)
      Loads a percentage bar from a given element
      Parameters:
      instance - the instance class
      element - the element
      Returns:
      the percentage bar
    • 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
    • getValue

      public float getValue()
      Gets the value as a float in between (0,1) this bar is currently set at.
      Returns:
      the value
      Since:
      1.0.1
    • setValue

      public void setValue(float value)
      Sets the value of this bar. The value has to be in (0,1). If not, this method will throw an IllegalArgumentException.
      Parameters:
      value - the new value.
      Throws:
      IllegalArgumentException - when the value is out of range
      Since:
      1.0.1