All Implemented Interfaces:
Flippable, Orientable, Rotatable

public class Label extends OutlinePane
A label for displaying text.
Since:
1.0.1

Created at 04.09.2020

Author:
Despical
  • Constructor Details

    • Label

      public Label(int x, int y, int length, int height, @NotNull @NotNull Pane.Priority priority, @NotNull @NotNull Font font)
      Creates a new label
      Parameters:
      x - the x coordinate
      y - the y coordinate
      length - the length
      height - the height
      priority - the priority
      font - the character set
      Since:
      1.0.1
    • Label

      public Label(int x, int y, int length, int height, @NotNull @NotNull Font font)
      Creates a new label
      Parameters:
      x - the x coordinate
      y - the y coordinate
      length - the length
      height - the height
      font - the character set
      Since:
      1.0.1
    • Label

      public Label(int length, int height, @NotNull @NotNull Font font)
      Creates a new label
      Parameters:
      length - the length
      height - the height
      font - the character set
      Since:
      1.0.1
  • Method Details

    • load

      @NotNull @Contract(pure=true) public static @NotNull Label load(@NotNull @NotNull Object instance, @NotNull @NotNull Element element)
      Loads a label 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
      Overrides:
      click in class OutlinePane
      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
    • getText

      @Contract(pure=true) @NotNull public @NotNull String getText()
      Gets the text currently displayed in this label
      Returns:
      the text in this label
      Since:
      1.0.1
    • setText

      public void setText(@NotNull @NotNull String text)
      Sets the text to be displayed in this label
      Parameters:
      text - the new text
      Since:
      1.0.1
    • getFont

      @Contract(pure=true) @NotNull public @NotNull Font getFont()
      Gets the character set currently used for the text in this label
      Returns:
      the character set
      Since:
      1.0.1