Class Page
- java.lang.Object
-
- net.frozenspace.frostlib.gui.design.Page
-
public class Page extends java.lang.ObjectThis class represent a GUI page
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PageaddActionItem(ActionItem item, int slot)Add an action item to the pagePageaddActionItem(ActionItem item, int row, int column)Add an action item to the pagePageaddActionItem(ActionItem item, Row row, Column column)Add an action item to the pagePageaddItem(Item item, int slot)Add an action item to the pagePageaddItem(Item item, int row, int column)Add an item to the pagePageaddItem(Item item, Row row, Column column)Add an action item to the pagevoidapplyPattern(Pattern pattern)Apply a pattern to this pagestatic intcalculateSlot(int row, int column)Method used for calculate the slot using row/columnstatic intcalculateSlot(Row row, Column column)Method used for calculate the slot using row/columnvoidclick(org.bukkit.entity.Player player, int slot)This method is used for firing a click by a the selected player in the selected slotPatterncreatePattern()Create a new pattern instance of the correct sizebooleanequals(java.lang.Object o)Define if an object is equals to this page@NotNull org.bukkit.inventory.InventorygetInventory()Get the inventory of the page@NotNull java.lang.StringgetName()Get the name of the pagevoidupdate()Update the inventory with correct items and call #update() for all players viewer
-
-
-
Method Detail
-
calculateSlot
public static int calculateSlot(Row row, Column column)
Method used for calculate the slot using row/column- Parameters:
row- Row wantedcolumn- Column wanted- Returns:
- The slot
-
calculateSlot
public static int calculateSlot(int row, int column)Method used for calculate the slot using row/column- Parameters:
row- Row wantedcolumn- Column wanted- Returns:
- The slot
-
createPattern
public Pattern createPattern()
Create a new pattern instance of the correct size- Returns:
- The pattern instance created
-
applyPattern
public void applyPattern(Pattern pattern)
Apply a pattern to this page- Parameters:
pattern- Pattern to apply
-
addActionItem
public Page addActionItem(ActionItem item, Row row, Column column)
Add an action item to the page- Parameters:
item- Item to addrow- Row where the item need to becolumn- Column where the item need to be- Returns:
- Current page
-
addActionItem
public Page addActionItem(ActionItem item, int row, int column)
Add an action item to the page- Parameters:
item- Item to addrow- Row where the item need to becolumn- Column where the item need to be- Returns:
- Current page
-
addActionItem
public Page addActionItem(ActionItem item, int slot)
Add an action item to the page- Parameters:
item- Item to addslot- Slot where the item is- Returns:
- Current page
-
addItem
public Page addItem(Item item, int row, int column)
Add an item to the page- Parameters:
item- Item to addrow- Row where the item need to becolumn- Column where the item need to be- Returns:
- Current page
-
addItem
public Page addItem(Item item, Row row, Column column)
Add an action item to the page- Parameters:
item- Item to addrow- Row where the item need to becolumn- Column where the item need to be- Returns:
- Current page
-
addItem
public Page addItem(Item item, int slot)
Add an action item to the page- Parameters:
item- Item to addslot- Slot where the item is- Returns:
- Current page
-
update
public void update()
Update the inventory with correct items and call #update() for all players viewer
-
click
public void click(org.bukkit.entity.Player player, int slot)This method is used for firing a click by a the selected player in the selected slot- Parameters:
player- Player who clickedslot- Slot where he clicked
-
getName
@NotNull public @NotNull java.lang.String getName()
Get the name of the page- Returns:
- The name of the page
-
getInventory
@NotNull public @NotNull org.bukkit.inventory.Inventory getInventory()
Get the inventory of the page- Returns:
- The inventory of the page
-
equals
public boolean equals(java.lang.Object o)
Define if an object is equals to this page- Overrides:
equalsin classjava.lang.Object- Parameters:
o- Object to check- Returns:
- True if equals false if not
-
-