Class CycleButton
java.lang.Object
com.github.stefvanschie.inventoryframework.pane.Pane
com.github.stefvanschie.inventoryframework.pane.component.CycleButton
-
Nested Class Summary
Nested classes/interfaces inherited from class Pane
Pane.Priority -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCycleButton(int length, int height) Creates a new cycle buttonCycleButton(int length, int height, @NotNull Pane.Priority priority) Creates a new cycle button -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a pane to the current list of optionsvoidAdds a pane to the current list of optionsvoidclear()Clears the entire pane of any items/panes.booleanclick(@NotNull Gui gui, @NotNull GuiComponent guiComponent, @NotNull InventoryClickEvent event, @NotNull Slot slot) Called whenever there is being clicked on this pane@NotNull CycleButtoncopy()Makes a copy of this pane and returns it.voidcycle()Cycles through one option, making it go to the next one@NotNull GuiItemContainerdisplay()Returns aGuiItemContainerwith all the items that should be displayed of this pane.@NotNull Collection<GuiItem> getItems()Gets all the items in this pane and all underlying panes.@NotNull Collection<Pane> getPanes()Gets all the panes in this panes, including any child panes from other panes.static @NotNull CycleButtonLoads a cycle button from a given elementMethods inherited from class Pane
callOnClick, createBorder, findMatchingItem, getHeight, getLength, getPriority, getUUID, isVisible, load, matchesItem, setHeight, setLength, setOnClick, setPriority, setVisible
-
Constructor Details
-
CycleButton
Creates a new cycle button- Parameters:
length- the length of the buttonheight- the height of the buttonpriority- the priority of the button- Since:
- 0.12.0
-
CycleButton
public CycleButton(int length, int height) Creates a new cycle button- Parameters:
length- the length of the buttonheight- the height of the button- Since:
- 0.12.0
-
-
Method Details
-
click
public boolean click(@NotNull @NotNull Gui gui, @NotNull @NotNull GuiComponent guiComponent, @NotNull @NotNull InventoryClickEvent event, @NotNull @NotNull Slot slot) Description copied from class:PaneCalled whenever there is being clicked on this pane -
display
Description copied from class:PaneReturns aGuiItemContainerwith all the items that should be displayed of this pane. -
copy
Description 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. -
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.) -
addPane
Adds a pane to the current list of options- Parameters:
index- the index to insert the pane atpane- the pane to add- Since:
- 0.5.0
-
addPane
Adds a pane to the current list of options- Parameters:
pane- the pane to add- Since:
- 0.5.0
-
clear
-
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.) -
cycle
public void cycle()Cycles through one option, making it go to the next one- Since:
- 0.5.0
-
load
@NotNull public static @NotNull CycleButton load(@NotNull @NotNull Object instance, @NotNull @NotNull Element element, @NotNull @NotNull Plugin plugin) Loads a cycle button from a given element- Parameters:
instance- the instance classelement- the elementplugin- the plugin that will be the owner of the underlying items- Returns:
- the cycle button
- Since:
- 0.10.8
-