Class Menu


  • public class Menu
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean clickAction​(java.lang.String action)
      Clicks the menu action given.
      static boolean clickAction​(java.lang.String action, java.lang.String name)
      Click action.
      static boolean clickAction​(java.lang.String action, java.lang.String name, int id)
      Click action.
      static boolean clickAction​(java.lang.String action, java.lang.String name, Entity entity)
      Click action.
      static boolean clickAction​(java.lang.String action, Entity entity)
      Click action.
      static boolean clickIndex​(int index)
      Click index.
      static boolean close()
      Removes the current menu from the game interface.
      static boolean contains​(java.lang.String action)
      Determines if menu contains action (NOT THE ENTITY/OBJECT NAME) in one of the menu rows.
      static boolean contains​(java.lang.String action, java.lang.String object, Entity entity)
      Contains boolean.
      static boolean contains​(java.lang.String action, Entity entity)
      Determines if menu contains action (NOT THE ENTITY/OBJECT NAME) in one of the menu rows.
      static boolean containsEntity​(Entity entity)  
      static boolean containsObject​(java.lang.String name)
      Determines if menu contains object name (NOT THE ACTION) in one of the menu rows.
      static java.awt.Rectangle getBounds()
      Gets bounds.
      static int getCount()  
      static java.lang.String getDefaultAction()
      Gets default action.
      static MenuRow getFirstMenuRow()  
      static int getHeight()  
      static int getIndex​(java.lang.String action)
      Gets the index of offset menu item in the list of menu items
      static int getIndex​(java.lang.String action, java.lang.String object)
      Gets index.
      static int getIndex​(java.lang.String action, java.lang.String object, int id)
      Gets the index of offset menu item in the list of menu items using the given action, object, and entity index if provided.
      static int getIndex​(java.lang.String action, java.lang.String object, Entity entity)
      Gets index.
      static int getIndex​(java.lang.String action, Entity entity)
      Gets index.
      static java.awt.Rectangle getIndexRectangle​(int index)
      Gets index rectangle.
      static java.util.List<MenuRow> getMenuRows()
      Gets each row of the menu as a MenuRow object
      static java.lang.String[] getOptions()  
      static int getWidth()  
      static int getX()  
      static int getY()  
      static boolean hover​(int index)  
      static boolean inject​(MenuRow row)  
      static boolean inject​(MenuRow row, java.awt.Point p)  
      static boolean isMenuManipulationActive()  
      static boolean isMouseOnAction​(int index)
      Is mouse on action.
      static boolean isMouseOnAction​(java.lang.String action)
      Is mouse on action.
      static boolean isVisible()  
      static boolean mouseOverAction​(int index)
      Mouse over action.
      static boolean mouseOverAction​(java.lang.String action)
      Mouse over action.
      static boolean open()  
      static void toggleMenuManipulation​(boolean toggle)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • containsEntity

        public static boolean containsEntity​(Entity entity)
      • isVisible

        public static boolean isVisible()
      • getHeight

        public static int getHeight()
      • getWidth

        public static int getWidth()
      • getY

        public static int getY()
      • getX

        public static int getX()
      • getCount

        public static int getCount()
      • getOptions

        public static java.lang.String[] getOptions()
      • getIndex

        public static int getIndex​(java.lang.String action,
                                   java.lang.String object,
                                   Entity entity)
        Gets index.
        Parameters:
        action - the action
        object - the object
        entity - the entity
        Returns:
        the index
      • getFirstMenuRow

        public static MenuRow getFirstMenuRow()
      • getMenuRows

        public static java.util.List<MenuRow> getMenuRows()
        Gets each row of the menu as a MenuRow object
        Returns:
        List of MenuRow
      • getBounds

        public static java.awt.Rectangle getBounds()
        Gets bounds.
        Returns:
        the bounds
      • getDefaultAction

        public static java.lang.String getDefaultAction()
        Gets default action.
        Returns:
        the default action
      • getIndex

        public static int getIndex​(java.lang.String action)
        Gets the index of offset menu item in the list of menu items
        Parameters:
        action - The action to look for
        Returns:
        The index of the item if it was found, otherwise -1.
      • getIndex

        public static int getIndex​(java.lang.String action,
                                   Entity entity)
        Gets index.
        Parameters:
        action - the action
        entity - the entity
        Returns:
        the index
      • getIndex

        public static int getIndex​(java.lang.String action,
                                   java.lang.String object)
        Gets index.
        Parameters:
        action - the action
        object - the object
        Returns:
        the index
      • getIndex

        public static int getIndex​(java.lang.String action,
                                   java.lang.String object,
                                   int id)
        Gets the index of offset menu item in the list of menu items using the given action, object, and entity index if provided.
        Parameters:
        action - the action to get the index for
        object - the object to get the index for
        id - the entity id to get exact index, use -1 to ignore
        Returns:
        The index of the item if it was found, otherwise -1.
      • clickAction

        public static boolean clickAction​(java.lang.String action)
        Clicks the menu action given.
        Parameters:
        action - The action to click, using best option.
        Returns:
        the boolean
      • clickAction

        public static boolean clickAction​(java.lang.String action,
                                          java.lang.String name)
        Click action.
        Parameters:
        action - the action
        name - the name
        Returns:
        the boolean
      • clickAction

        public static boolean clickAction​(java.lang.String action,
                                          java.lang.String name,
                                          Entity entity)
        Click action.
        Parameters:
        action - the action
        name - the name
        entity - the entity
        Returns:
        the boolean
      • clickAction

        public static boolean clickAction​(java.lang.String action,
                                          Entity entity)
        Click action.
        Parameters:
        action - the action
        entity - the entity
        Returns:
        the boolean
      • clickAction

        public static boolean clickAction​(java.lang.String action,
                                          java.lang.String name,
                                          int id)
        Click action.
        Parameters:
        action - the action
        name - the name of the object
        id - the entity index
        Returns:
        the boolean
      • clickIndex

        public static boolean clickIndex​(int index)
        Click index.
        Parameters:
        index - the index
        Returns:
        the boolean
      • open

        public static boolean open()
      • getIndexRectangle

        public static java.awt.Rectangle getIndexRectangle​(int index)
        Gets index rectangle.
        Parameters:
        index - the index
        Returns:
        the index rectangle
      • mouseOverAction

        public static boolean mouseOverAction​(java.lang.String action)
        Mouse over action.
        Parameters:
        action - the action
        Returns:
        the boolean
      • mouseOverAction

        public static boolean mouseOverAction​(int index)
        Mouse over action.
        Parameters:
        index - the index
        Returns:
        the boolean
      • isMouseOnAction

        public static boolean isMouseOnAction​(java.lang.String action)
        Is mouse on action.
        Parameters:
        action - the action
        Returns:
        the boolean
      • isMouseOnAction

        public static boolean isMouseOnAction​(int index)
        Is mouse on action.
        Parameters:
        index - the index
        Returns:
        the boolean
      • close

        public static boolean close()
        Removes the current menu from the game interface.
        Returns:
        the boolean
      • containsObject

        public static boolean containsObject​(java.lang.String name)
        Determines if menu contains object name (NOT THE ACTION) in one of the menu rows.
        Parameters:
        name - the name of the entity/object to check
        Returns:
        true if menu contains name, otherwise false
      • contains

        public static boolean contains​(java.lang.String action)
        Determines if menu contains action (NOT THE ENTITY/OBJECT NAME) in one of the menu rows.
        Parameters:
        action - the action to check
        Returns:
        true if menu contains action, otherwise false
      • contains

        public static boolean contains​(java.lang.String action,
                                       Entity entity)
        Determines if menu contains action (NOT THE ENTITY/OBJECT NAME) in one of the menu rows.
        Parameters:
        action - the action to check
        entity - the to filter search
        Returns:
        true if menu contains action, otherwise false
      • contains

        public static boolean contains​(java.lang.String action,
                                       java.lang.String object,
                                       Entity entity)
        Contains boolean.
        Parameters:
        action - the action
        object - the object
        entity - the entity
        Returns:
        the boolean
      • isMenuManipulationActive

        public static boolean isMenuManipulationActive()
      • toggleMenuManipulation

        public static void toggleMenuManipulation​(boolean toggle)
      • inject

        public static boolean inject​(MenuRow row)
      • inject

        public static boolean inject​(MenuRow row,
                                     java.awt.Point p)
      • hover

        public static boolean hover​(int index)