Class VariableBar
java.lang.Object
me.despical.inventoryframework.pane.Pane
me.despical.inventoryframework.pane.component.util.VariableBar
- All Implemented Interfaces:
Flippable,Orientable
- Direct Known Subclasses:
PercentageBar,Slider
A variable bar for UI elements that require some sort of bar
- 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
FieldsModifier and TypeFieldDescriptionprotected final @NotNull OutlinePaneThe green and the red parts of the sliderprotected final @NotNull OutlinePaneThe green and the red parts of the sliderprotected booleanWhether the pane is flipped horizontally or verticallyprotected booleanWhether the pane is flipped horizontally or verticallyprotected @NotNull Orientable.OrientationThe orientation of the sliderprotected floatThe value this slider is at. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVariableBar(int length, int height) protectedVariableBar(int x, int y, int length, int height) protectedVariableBar(int x, int y, int length, int height, @NotNull Pane.Priority priority) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the entire pane of any items/panes.voiddisplay(@NotNull Gui gui, @NotNull org.bukkit.inventory.Inventory inventory, @NotNull org.bukkit.inventory.PlayerInventory playerInventory, int paneOffsetX, int paneOffsetY, int maxLength, int maxHeight) Has to set all the items in the right spot inside the inventoryvoidflipHorizontally(boolean flipHorizontally) Sets whether this pane should flip its items horizontallyvoidflipVertically(boolean flipVertically) Sets whether this pane should flip its items vertically@NotNull Collection<GuiItem> getItems()Gets all the items in this pane and all underlying panes.@NotNull Orientable.OrientationGets the orientation of this outline pane@NotNull Collection<Pane> getPanes()Gets all the panes in this panes, including any child panes from other panes.booleanGets whether this pane's items are flipped horizontallybooleanGets whether this pane's items are flipped verticallyvoidsetBackgroundItem(@NotNull GuiItem item) Sets the background itemvoidsetFillItem(@NotNull GuiItem item) Sets the fill item (foreground)voidsetHeight(int height) Set the height of this panevoidsetLength(int length) Set the length of this panevoidsetOrientation(@NotNull Orientable.Orientation orientation) Sets the orientation of this outline panevoidsetX(int x) Set the x coordinate of this panevoidsetY(int y) Set the y coordinate of this paneMethods inherited from class me.despical.inventoryframework.pane.Pane
click, findMatchingItem, getHeight, getLength, getPriority, getPropertyMappings, getX, getY, isVisible, load, loadItem, registerProperty, setOnClick, setOnLocalClick, setPriority, setVisible
-
Field Details
-
fillPane
The green and the red parts of the slider -
backgroundPane
The green and the red parts of the slider -
value
protected float valueThe value this slider is at. This is a value between 0 and 1 (both inclusive). -
orientation
The orientation of the slider -
flipHorizontally
protected boolean flipHorizontallyWhether the pane is flipped horizontally or vertically -
flipVertically
protected boolean flipVerticallyWhether the pane is flipped horizontally or vertically
-
-
Constructor Details
-
VariableBar
protected VariableBar(int length, int height) -
VariableBar
protected VariableBar(int x, int y, int length, int height, @NotNull @NotNull Pane.Priority priority) -
VariableBar
protected VariableBar(int x, int y, int length, int height)
-
-
Method Details
-
setLength
public void setLength(int length) Description copied from class:PaneSet the length of this pane -
setHeight
public void setHeight(int height) Description copied from class:PaneSet the height of this pane -
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:PaneHas to set all the items in the right spot inside the inventory- Specified by:
displayin classPane- Parameters:
gui- the gui for which we're renderinginventory- the inventory that the items should be displayed inplayerInventory- the player's inventorypaneOffsetX- 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
-
setX
public void setX(int x) Description copied from class:PaneSet the x coordinate of this pane -
setY
public void setY(int y) Description copied from class:PaneSet the y coordinate of this pane -
setFillItem
Sets the fill item (foreground)- Parameters:
item- the new item- Since:
- 1.0.1
-
setBackgroundItem
Sets the background item- Parameters:
item- the new item- Since:
- 1.0.1
-
getItems
Description copied from class:PaneGets 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.) -
getPanes
Description copied from class:PaneGets 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.) -
flipHorizontally
public void flipHorizontally(boolean flipHorizontally) Description copied from interface:FlippableSets whether this pane should flip its items horizontally- Specified by:
flipHorizontallyin interfaceFlippable- Parameters:
flipHorizontally- whether the pane should flip items horizontally
-
flipVertically
public void flipVertically(boolean flipVertically) Description copied from interface:FlippableSets whether this pane should flip its items vertically- Specified by:
flipVerticallyin interfaceFlippable- Parameters:
flipVertically- whether the pane should flip items vertically
-
getOrientation
Description copied from interface:OrientableGets the orientation of this outline pane- Specified by:
getOrientationin interfaceOrientable- Returns:
- the orientation
-
setOrientation
Description copied from interface:OrientableSets the orientation of this outline pane- Specified by:
setOrientationin interfaceOrientable- Parameters:
orientation- the new orientation
-
isFlippedHorizontally
public boolean isFlippedHorizontally()Description copied from interface:FlippableGets whether this pane's items are flipped horizontally- Specified by:
isFlippedHorizontallyin interfaceFlippable- Returns:
- true if the items are flipped horizontally, false otherwise
-
isFlippedVertically
public boolean isFlippedVertically()Description copied from interface:FlippableGets whether this pane's items are flipped vertically- Specified by:
isFlippedVerticallyin interfaceFlippable- Returns:
- true if the items are flipped vertically, false otherwise
-
clear
public void clear()Description copied from class:PaneClears the entire pane of any items/panes. Underlying panes will not be cleared.
-