Class Page


  • public class Page
    extends java.lang.Object
    This class represent a GUI page
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Page addActionItem​(ActionItem item, int slot)
      Add an action item to the page
      Page addActionItem​(ActionItem item, int row, int column)
      Add an action item to the page
      Page addActionItem​(ActionItem item, Row row, Column column)
      Add an action item to the page
      Page addItem​(Item item, int slot)
      Add an action item to the page
      Page addItem​(Item item, int row, int column)
      Add an item to the page
      Page addItem​(Item item, Row row, Column column)
      Add an action item to the page
      void applyPattern​(Pattern pattern)
      Apply a pattern to this page
      static int calculateSlot​(int row, int column)
      Method used for calculate the slot using row/column
      static int calculateSlot​(Row row, Column column)
      Method used for calculate the slot using row/column
      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
      Pattern createPattern()
      Create a new pattern instance of the correct size
      boolean equals​(java.lang.Object o)
      Define if an object is equals to this page
      @NotNull org.bukkit.inventory.Inventory getInventory()
      Get the inventory of the page
      @NotNull java.lang.String getName()
      Get the name of the page
      void update()
      Update the inventory with correct items and call #update() for all players viewer
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • calculateSlot

        public static int calculateSlot​(Row row,
                                        Column column)
        Method used for calculate the slot using row/column
        Parameters:
        row - Row wanted
        column - 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 wanted
        column - 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 add
        row - Row where the item need to be
        column - 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 add
        row - Row where the item need to be
        column - 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 add
        slot - 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 add
        row - Row where the item need to be
        column - 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 add
        row - Row where the item need to be
        column - 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 add
        slot - 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 clicked
        slot - 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:
        equals in class java.lang.Object
        Parameters:
        o - Object to check
        Returns:
        True if equals false if not