Class Slider
java.lang.Object
com.github.stefvanschie.inventoryframework.pane.Pane
com.github.stefvanschie.inventoryframework.pane.component.util.VariableBar
com.github.stefvanschie.inventoryframework.pane.component.Slider
- All Implemented Interfaces:
- Flippable,- Orientable
A slider for a graphical interface into what amount of a whole is set.
- 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 SummaryFields inherited from class com.github.stefvanschie.inventoryframework.pane.component.util.VariableBarbackgroundPane, fillPane, flipHorizontally, flipVertically, orientation, value
- 
Constructor SummaryConstructorsConstructorDescriptionSlider(int length, int height) Slider(int x, int y, int length, int height) Slider(int x, int y, int length, int height, @NotNull Pane.Priority priority) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanclick(@NotNull Gui gui, @NotNull InventoryComponent inventoryComponent, @NotNull InventoryClickEvent event, int slot, int paneOffsetX, int paneOffsetY, int maxLength, int maxHeight) Called whenever there is being clicked on this pane@NotNull Slidercopy()Makes a copy of this pane and returns it.floatgetValue()Gets the value as a float in between (0,1) this bar is currently set at.static @NotNull SliderLoads a percentage bar from a given elementvoidsetValue(float value) Sets the value of this bar.Methods inherited from class com.github.stefvanschie.inventoryframework.pane.component.util.VariableBarapplyContents, clear, display, flipHorizontally, flipVertically, getItems, getOrientation, getPanes, isFlippedHorizontally, isFlippedVertically, setBackgroundItem, setFillItem, setHeight, setLength, setOrientationMethods inherited from class com.github.stefvanschie.inventoryframework.pane.PanecallOnClick, findMatchingItem, getHeight, getLength, getPriority, getUUID, getX, getY, isVisible, load, loadItem, registerProperty, setOnClick, setPriority, setVisible, setX, setY
- 
Constructor Details- 
Slider
- 
Sliderpublic Slider(int x, int y, int length, int height) 
- 
Sliderpublic Slider(int length, int height) 
 
- 
- 
Method Details- 
clickpublic boolean click(@NotNull @NotNull Gui gui, @NotNull @NotNull InventoryComponent inventoryComponent, @NotNull @NotNull InventoryClickEvent event, int slot, int paneOffsetX, int paneOffsetY, int maxLength, int maxHeight) Description copied from class:PaneCalled whenever there is being clicked on this pane- Specified by:
- clickin class- Pane
- Parameters:
- gui- the gui in which was clicked
- inventoryComponent- the inventory component in which this pane resides
- event- the event that occurred while clicking on this item
- slot- the slot that was clicked in
- 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
 
- 
setValuepublic 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.- Overrides:
- setValuein class- VariableBar
- Parameters:
- value- the new value.
- Throws:
- IllegalArgumentException- when the value is out of range
- Since:
- 0.5.0
- See Also:
 
- 
copyDescription copied from class:PaneMakes a copy of this pane and returns it. This makes a deep copy of the pane. This entails that the underlying panes and/or items will be copied as well. The returned pane will never be reference equal to the current pane.
- 
getValuepublic float getValue()Gets the value as a float in between (0,1) this bar is currently set at.- Returns:
- the value
- Since:
- 0.5.0
 
- 
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
 
 
-