Class Label
java.lang.Object
me.despical.inventoryframework.pane.Pane
me.despical.inventoryframework.pane.OutlinePane
me.despical.inventoryframework.pane.component.Label
- All Implemented Interfaces:
Flippable,Orientable,Rotatable
A label for displaying text.
- Since:
- 1.0.1
Created at 04.09.2020
- Author:
- Despical
-
Nested Class Summary
Nested classes/interfaces inherited from class me.despical.inventoryframework.pane.Pane
Pane.PriorityNested classes/interfaces inherited from interface me.despical.inventoryframework.pane.Orientable
Orientable.Orientation -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanclick(@NotNull Gui gui, @NotNull org.bukkit.event.inventory.InventoryClickEvent event, int paneOffsetX, int paneOffsetY, int maxLength, int maxHeight) Called whenever there is being clicked on this pane@NotNull FontgetFont()Gets the character set currently used for the text in this label@NotNull StringgetText()Gets the text currently displayed in this labelstatic @NotNull LabelLoads a label from a given elementvoidSets the text to be displayed in this labelMethods inherited from class me.despical.inventoryframework.pane.OutlinePane
addItem, applyMask, clear, display, doesRepeat, flipHorizontally, flipVertically, getGap, getItems, getOrientation, getPanes, getRotation, insertItem, isFlippedHorizontally, isFlippedVertically, removeItem, setGap, setOrientation, setRepeat, setRotationMethods inherited from class me.despical.inventoryframework.pane.Pane
findMatchingItem, getHeight, getLength, getPriority, getPropertyMappings, getX, getY, isVisible, load, loadItem, registerProperty, setHeight, setLength, setOnClick, setOnLocalClick, setPriority, setVisible, setX, setY
-
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 coordinatey- the y coordinatelength- the lengthheight- the heightpriority- the priorityfont- the character set- Since:
- 1.0.1
-
Label
Creates a new label- Parameters:
x- the x coordinatey- the y coordinatelength- the lengthheight- the heightfont- the character set- Since:
- 1.0.1
-
Label
Creates a new label- Parameters:
length- the lengthheight- the heightfont- 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 classelement- 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:PaneCalled whenever there is being clicked on this pane- Overrides:
clickin classOutlinePane- Parameters:
gui- the gui this event stems fromevent- the event that occurred while clicking on this itempaneOffsetX- the pane's offset on the x axispaneOffsetY- the pane's offset on the y axismaxLength- the maximum length of the panemaxHeight- the maximum height of the pane- Returns:
- whether the item was found or not
-
getText
Gets the text currently displayed in this label- Returns:
- the text in this label
- Since:
- 1.0.1
-
setText
Sets the text to be displayed in this label- Parameters:
text- the new text- Since:
- 1.0.1
-
getFont
Gets the character set currently used for the text in this label- Returns:
- the character set
- Since:
- 1.0.1
-