Class Interfaces
- java.lang.Object
-
- com.runemate.game.api.hybrid.local.hud.interfaces.Interfaces
-
public final class Interfaces extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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 powersstatic @Nullable InterfaceComponent
getAt(int containerIndex, int componentIndex)
Gets the component at the specified index.static @Nullable InterfaceComponent
getAt(int containerIndex, int componentIndex, int subComponentIndex)
Gets the component at the specified index.static java.util.function.Predicate<InterfaceComponent>
getHeightPredicate(int height)
static InterfaceComponentQueryResults
getLoaded()
static InterfaceComponentQueryResults
getLoaded(java.util.function.Predicate<InterfaceComponent> predicate)
static java.util.function.Predicate<InterfaceComponent>
getNamePredicate(java.lang.String... acceptedNames)
static java.util.function.Predicate<InterfaceComponent>
getProjectedBufferPredicate(int... acceptedBufferIds)
static java.util.function.Predicate<InterfaceComponent>
getProjectedItemPredicate(java.util.function.Predicate<ItemDefinition> itemPredicate)
static java.util.function.Predicate<InterfaceComponent>
getProjectedNpcPredicate(java.util.function.Predicate<NpcDefinition> npcPredicate)
static java.util.function.Predicate<InterfaceComponent>
getProjectedPlayerPredicate(java.util.function.Predicate<Player> playerPredicate)
static @Nullable InterfaceComponent
getSelected()
static java.util.function.Predicate<InterfaceComponent>
getSizePredicate(int width, int height)
static java.util.function.Predicate<InterfaceComponent>
getSpritePredicate(int... acceptedSpriteIds)
Gets a InterfaceComponent Predicate that can be used to get the components with the specified spritestatic java.util.function.Predicate<InterfaceComponent>
getTextColorPredicate(java.awt.Color... acceptedColors)
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)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)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)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)static java.util.function.Predicate<InterfaceComponent>
getTexturePredicate(int... acceptedTextureIds)
Deprecated.static java.util.function.Predicate<InterfaceComponent>
getVisiblePredicate()
static java.util.function.Predicate<InterfaceComponent>
getWidthPredicate(int width)
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 valuestatic InterfaceComponentQueryBuilder
newQuery()
static boolean
scrollTo(InterfaceComponent component, InterfaceComponent viewport)
Scrolls until the component is visible within the viewportstatic boolean
scrollTo(SpriteItem item, InteractableRectangle viewport)
static boolean
scrollTo(SpriteItem item, InterfaceComponent viewport)
static boolean
scrollTo(java.util.concurrent.Callable<java.awt.Rectangle> viewableCall, InteractableRectangle viewport)
-
-
-
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)
-
getLoaded
public static InterfaceComponentQueryResults getLoaded(java.util.function.Predicate<InterfaceComponent> predicate)
-
getLoaded
public static InterfaceComponentQueryResults getLoaded()
-
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)
-
getSelected
@Nullable public static @Nullable InterfaceComponent getSelected()
-
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 sensitiveacceptedText
- 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 sensitiveacceptedText
- 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)
-
newQuery
public static InterfaceComponentQueryBuilder newQuery()
-
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 seeviewport
- 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 componentviewport
- 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)
-
scrollTo
public static boolean scrollTo(SpriteItem item, InteractableRectangle viewport)
-
scrollTo
public static boolean scrollTo(SpriteItem item, InterfaceComponent viewport)
-
-