Class VariableBar
java.lang.Object
com.github.stefvanschie.inventoryframework.pane.Pane
com.github.stefvanschie.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:
- 0.5.0
- 
Nested Class SummaryNested classes/interfaces inherited from class com.github.stefvanschie.inventoryframework.pane.PanePane.PriorityNested classes/interfaces inherited from interface com.github.stefvanschie.inventoryframework.pane.OrientableOrientable.Orientation
- 
Field SummaryFieldsModifier 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 SummaryConstructorsModifierConstructorDescriptionprotectedVariableBar(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 SummaryModifier and TypeMethodDescriptionprotected voidapplyContents(@NotNull VariableBar copy) Applies the contents of this variable bar onto the provided copy of this variable bar.voidclear()Clears the entire pane of any items/panes.voiddisplay(@NotNull InventoryComponent inventoryComponent, 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 paneprotected voidsetValue(float value) Sets the value of this bar.Methods inherited from class com.github.stefvanschie.inventoryframework.pane.PanecallOnClick, click, copy, findMatchingItem, getHeight, getLength, getPriority, getUUID, getX, getY, isVisible, load, loadItem, registerProperty, setOnClick, setPriority, setVisible, setX, setY
- 
Field Details- 
fillPaneThe green and the red parts of the slider
- 
backgroundPaneThe green and the red parts of the slider
- 
valueprotected float valueThe value this slider is at. This is a value between 0 and 1 (both inclusive).
- 
orientationThe orientation of the slider
- 
flipHorizontallyprotected boolean flipHorizontallyWhether the pane is flipped horizontally or vertically
- 
flipVerticallyprotected boolean flipVerticallyWhether the pane is flipped horizontally or vertically
 
- 
- 
Constructor Details- 
VariableBarprotected VariableBar(int length, int height) 
- 
VariableBarprotected VariableBar(int x, int y, int length, int height, @NotNull @NotNull Pane.Priority priority) 
- 
VariableBarprotected VariableBar(int x, int y, int length, int height) 
 
- 
- 
Method Details- 
setValueprotected void setValue(float value) Sets the value of this bar. The value has to be in (0,1). If not, this method will throw anIllegalArgumentException.- Parameters:
- value- the new value.
- Throws:
- IllegalArgumentException- when the value is out of range
- Since:
- 0.9.5
 
- 
setLengthpublic void setLength(int length) Description copied from class:PaneSet the length of this pane
- 
setHeightpublic void setHeight(int height) Description copied from class:PaneSet the height of this pane
- 
applyContentsApplies the contents of this variable bar onto the provided copy of this variable bar. This variable bar will not be modified.- Parameters:
- copy- the copy of the variable bar
- Since:
- 0.6.2
 
- 
setOrientationDescription copied from interface:OrientableSets the orientation of this outline pane- Specified by:
- setOrientationin interface- Orientable
- Parameters:
- orientation- the new orientation
 
- 
displaypublic void display(@NotNull @NotNull InventoryComponent inventoryComponent, 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 class- Pane
- Parameters:
- inventoryComponent- the inventory component in which the items should be displayed
- 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
 
- 
setFillItemSets the fill item (foreground)- Parameters:
- item- the new item
- Since:
- 0.5.0
 
- 
setBackgroundItemSets the background item- Parameters:
- item- the new item
- Since:
- 0.5.0
 
- 
getItemsDescription 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.)
- 
getPanesDescription 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.)
- 
flipHorizontallypublic void flipHorizontally(boolean flipHorizontally) Description copied from interface:FlippableSets whether this pane should flip its items horizontally- Specified by:
- flipHorizontallyin interface- Flippable
- Parameters:
- flipHorizontally- whether the pane should flip items horizontally
 
- 
flipVerticallypublic void flipVertically(boolean flipVertically) Description copied from interface:FlippableSets whether this pane should flip its items vertically- Specified by:
- flipVerticallyin interface- Flippable
- Parameters:
- flipVertically- whether the pane should flip items vertically
 
- 
getOrientationDescription copied from interface:OrientableGets the orientation of this outline pane- Specified by:
- getOrientationin interface- Orientable
- Returns:
- the orientation
 
- 
isFlippedHorizontallypublic boolean isFlippedHorizontally()Description copied from interface:FlippableGets whether this pane's items are flipped horizontally- Specified by:
- isFlippedHorizontallyin interface- Flippable
- Returns:
- true if the items are flipped horizontally, false otherwise
 
- 
isFlippedVerticallypublic boolean isFlippedVertically()Description copied from interface:FlippableGets whether this pane's items are flipped vertically- Specified by:
- isFlippedVerticallyin interface- Flippable
- Returns:
- true if the items are flipped vertically, false otherwise
 
- 
clearpublic void clear()Description copied from class:PaneClears the entire pane of any items/panes. Underlying panes will not be cleared.
 
-