Class Interfaces


  • public final class Interfaces
    extends java.lang.Object
    • Method Detail

      • getActionPredicate

        public static java.util.function.Predicate<InterfaceComponent> getActionPredicate​(java.lang.String... acceptedActions)
        Gets a InterfaceComponent Predicate that can be used to get the cachedComponents with the specified powers
        Parameters:
        acceptedActions - the powers that are valid (case-sensitive)
        Returns:
        a Predicate
      • getAt

        @Nullable
        public static @Nullable InterfaceComponent getAt​(int containerIndex,
                                                         int componentIndex)
        Gets the component at the specified index. This is not recommended and queries should be used instead in almost every situation.
      • getAt

        @Nullable
        public static @Nullable InterfaceComponent getAt​(int containerIndex,
                                                         int componentIndex,
                                                         int subComponentIndex)
        Gets the component at the specified index. This is not recommended and queries should be used instead in almost every situation.
      • getHeightPredicate

        public static java.util.function.Predicate<InterfaceComponent> getHeightPredicate​(int height)
      • getNamePredicate

        public static java.util.function.Predicate<InterfaceComponent> getNamePredicate​(java.lang.String... acceptedNames)
      • getProjectedBufferPredicate

        public static java.util.function.Predicate<InterfaceComponent> getProjectedBufferPredicate​(int... acceptedBufferIds)
      • getProjectedItemPredicate

        public static java.util.function.Predicate<InterfaceComponent> getProjectedItemPredicate​(java.util.function.Predicate<ItemDefinition> itemPredicate)
      • getProjectedNpcPredicate

        public static java.util.function.Predicate<InterfaceComponent> getProjectedNpcPredicate​(java.util.function.Predicate<NpcDefinition> npcPredicate)
      • getProjectedPlayerPredicate

        public static java.util.function.Predicate<InterfaceComponent> getProjectedPlayerPredicate​(java.util.function.Predicate<Player> playerPredicate)
      • getSizePredicate

        public static java.util.function.Predicate<InterfaceComponent> getSizePredicate​(int width,
                                                                                        int height)
      • getTextColorPredicate

        public static java.util.function.Predicate<InterfaceComponent> getTextColorPredicate​(java.awt.Color... acceptedColors)
      • getTextContainsPredicate

        public static java.util.function.Predicate<InterfaceComponent> getTextContainsPredicate​(java.lang.String... acceptedText)
        Gets a InterfaceComponent Predicate that can be used to get the cachedComponents with the specified text (.contains)
        Parameters:
        acceptedText - the text that is accepted by the Predicate (case-sensitive)
        Returns:
        a Predicate
      • getTextContainsPredicate

        public static java.util.function.Predicate<InterfaceComponent> getTextContainsPredicate​(boolean caseSensitive,
                                                                                                java.lang.String... acceptedText)
        Gets a InterfaceComponent Predicate that can be used to get the cachedComponents with the specified text (.contains)
        Parameters:
        caseSensitive - whether or not the comparison is case sensitive
        acceptedText - the text that is valid
        Returns:
        a Predicate
      • getTextEqualsPredicate

        public static java.util.function.Predicate<InterfaceComponent> getTextEqualsPredicate​(java.lang.String... acceptedText)
        Gets a InterfaceComponent Predicate that can be used to get the cachedComponents with the specified text (.equals)
        Parameters:
        acceptedText - the text that is valid (case-sensitive)
        Returns:
        a Predicate
      • getTextEqualsPredicate

        public static java.util.function.Predicate<InterfaceComponent> getTextEqualsPredicate​(boolean caseSensitive,
                                                                                              java.lang.String... acceptedText)
        Gets a InterfaceComponent Predicate that can be used to get the cachedComponents with the specified text (.equals)
        Parameters:
        caseSensitive - whether or not the comparison is case sensitive
        acceptedText - the text that is accepted by the Predicate
        Returns:
        a Predicate
      • getSpritePredicate

        public static java.util.function.Predicate<InterfaceComponent> getSpritePredicate​(int... acceptedSpriteIds)
        Gets a InterfaceComponent Predicate that can be used to get the components with the specified sprite
        Parameters:
        acceptedSpriteIds - the powers that are valid (case-sensitive)
        Returns:
        a Predicate
      • getTexturePredicate

        @Deprecated
        public static java.util.function.Predicate<InterfaceComponent> getTexturePredicate​(int... acceptedTextureIds)
        Deprecated.
        Gets a InterfaceComponent Predicate that can be used to get the ccmponents with the specified texture
        Parameters:
        acceptedTextureIds - the powers that are valid (case-sensitive)
        Returns:
        a Predicate
      • getVisiblePredicate

        public static java.util.function.Predicate<InterfaceComponent> getVisiblePredicate()
      • getWidthPredicate

        public static java.util.function.Predicate<InterfaceComponent> getWidthPredicate​(int width)
      • scrollTo

        public static boolean scrollTo​(InterfaceComponent component,
                                       InterfaceComponent viewport)
        Scrolls until the component is visible within the viewport
        Parameters:
        component - the component you want to see
        viewport - the viewport restricting visibility to the component
        Returns:
        true if the component is visible, else false
      • isVisibleInScrollpane

        public static boolean isVisibleInScrollpane​(java.awt.Rectangle child,
                                                    java.awt.Rectangle viewport)
        Checks if y-intersection of the child to viewport is more than a given value
        Parameters:
        child - Child component
        viewport - Viewport that should contain the child
        Returns:
        true if the child-viewport y-insertion is more than a PlayerSensed value
      • scrollTo

        public static boolean scrollTo​(java.util.concurrent.Callable<java.awt.Rectangle> viewableCall,
                                       InteractableRectangle viewport)