Class Menu


  • public class Menu
    extends java.lang.Object
    This class provides methods for accessing and manipulating the game menu.
    • Constructor Summary

      Constructors 
      Constructor Description
      Menu()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getCleanedToolTip()
      Returns a cleaned version of the first action in the menu with an optional menu target.
      static java.util.List<java.lang.String> getMenuActions()
      Returns a list of menu actions obtained from the client.
      static java.awt.Rectangle getMenuBounds()
      Returns the bounds of the menu.
      static java.awt.Rectangle getMenuItemBoundsByAction​(java.lang.String action)
      Retrieves the bounds of a menu item identified by its action.
      static java.awt.Rectangle getMenuItemBoundsByIndex​(int index)
      Retrieves the bounding rectangle of a menu item by its index.
      static java.awt.Rectangle getMenuItemsBounds()
      Returns the bounds of the menu items as a Rectangle object.
      static java.lang.String getMenuTarget()
      Retrieves the target of the first menu entry that has a non-empty target.
      static java.lang.String getToolTip()
      Returns the tooltip text for the menu, consisting of the first action and target (if available).
      static boolean isMenuOpen()
      Checks if the menu is open.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Menu

        public Menu()
    • Method Detail

      • isMenuOpen

        public static boolean isMenuOpen()
        Checks if the menu is open.
        Returns:
        true if the menu is open, false otherwise.
      • getMenuActions

        public static java.util.List<java.lang.String> getMenuActions()
        Returns a list of menu actions obtained from the client.
        Returns:
        a list of menu actions as strings
      • getMenuTarget

        public static java.lang.String getMenuTarget()
        Retrieves the target of the first menu entry that has a non-empty target.
        Returns:
        the target of the menu entry as a string, or an empty string if no menu entry has a target
      • getToolTip

        public static java.lang.String getToolTip()
        Returns the tooltip text for the menu, consisting of the first action and target (if available).
        Returns:
        the tooltip text, or an empty string if there are no menu actions
      • getCleanedToolTip

        public static java.lang.String getCleanedToolTip()
        Returns a cleaned version of the first action in the menu with an optional menu target.
        Returns:
        a string representing the cleaned tooltip with the menu action and target
      • getMenuBounds

        public static java.awt.Rectangle getMenuBounds()
        Returns the bounds of the menu.
        Returns:
        a Rectangle object representing the menu bounds
      • getMenuItemsBounds

        public static java.awt.Rectangle getMenuItemsBounds()
        Returns the bounds of the menu items as a Rectangle object.
        Returns:
        the bounds of the menu items
      • getMenuItemBoundsByIndex

        public static java.awt.Rectangle getMenuItemBoundsByIndex​(int index)
        Retrieves the bounding rectangle of a menu item by its index.
        Parameters:
        index - the index of the menu item (starting from 1)
        Returns:
        the bounding rectangle of the menu item, or null if not found
      • getMenuItemBoundsByAction

        public static java.awt.Rectangle getMenuItemBoundsByAction​(java.lang.String action)
        Retrieves the bounds of a menu item identified by its action.
        Parameters:
        action - the action associated with the menu item
        Returns:
        the bounding rectangle of the menu item, or null if the menu is not open or the item is not found