public class ToggleButton extends Pane
Pane.Priority| Constructor and Description |
|---|
ToggleButton(int length,
int height) |
ToggleButton(int x,
int y,
int length,
int height) |
ToggleButton(int x,
int y,
int length,
int height,
Pane.Priority priority) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the entire pane of any items/panes.
|
boolean |
click(Gui gui,
org.bukkit.event.inventory.InventoryClickEvent event,
int paneOffsetX,
int paneOffsetY,
int maxLength,
int maxHeight)
Called whenever there is being clicked on this pane
|
void |
display(Gui gui,
org.bukkit.inventory.Inventory inventory,
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 inventory
|
Collection<GuiItem> |
getItems()
Gets all the items in this pane and all underlying panes
|
Collection<Pane> |
getPanes()
Gets all the panes in this panes, including any child panes from other panes
|
static ToggleButton |
load(Object instance,
Element element)
Loads a toggle button from an XML element
|
void |
setDisabledItem(GuiItem item)
Sets the item to use when the button is set to disabled
|
void |
setEnabledItem(GuiItem item)
Sets the item to use when the button is set to enabled
|
void |
toggle()
Toggles between the enabled and disabled states
|
getHeight, getLength, getPriority, getPropertyMappings, getX, getY, isVisible, load, loadItem, setHeight, setLength, setOnClick, setOnLocalClick, setPriority, setVisible, setX, setYpublic ToggleButton(int x,
int y,
int length,
int height,
@NotNull
Pane.Priority priority)
public ToggleButton(int length,
int height)
public ToggleButton(int x,
int y,
int length,
int height)
public void display(@NotNull
Gui gui,
@NotNull
org.bukkit.inventory.Inventory inventory,
@NotNull
org.bukkit.inventory.PlayerInventory playerInventory,
int paneOffsetX,
int paneOffsetY,
int maxLength,
int maxHeight)
display in class Panegui - 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 panepublic boolean click(@NotNull
Gui gui,
@NotNull
org.bukkit.event.inventory.InventoryClickEvent event,
int paneOffsetX,
int paneOffsetY,
int maxLength,
int maxHeight)
click in class Panegui - 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 panepublic void setDisabledItem(@NotNull
GuiItem item)
item - the disabled itempublic void setEnabledItem(@NotNull
GuiItem item)
item - the enabled item@NotNull public Collection<GuiItem> getItems()
@NotNull public Collection<Pane> getPanes()
public void toggle()
public void clear()
@NotNull
@Contract(value="_, null -> fail",
pure=true)
public static ToggleButton load(@NotNull
Object instance,
@NotNull
Element element)
instance - the instance classelement - the elementCopyright © 2019. All rights reserved.