Class InterfaceComponent
- java.lang.Object
-
- com.runemate.game.api.hybrid.local.hud.interfaces.InterfaceComponent
-
- All Implemented Interfaces:
Identifiable
,Interactable
,Onymous
,Renderable
,Validatable
- Direct Known Subclasses:
OSRSInterfaceComponent
public abstract class InterfaceComponent extends java.lang.Object implements Validatable, Identifiable, Interactable, Renderable, Onymous
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InterfaceComponent.Type
-
Field Summary
Fields Modifier and Type Field Description InterfaceContainer
container
-
Constructor Summary
Constructors Constructor Description InterfaceComponent(InterfaceContainer container, long uid, int index, boolean rs3)
InterfaceComponent(InterfaceContainer container, InterfaceComponent parent, long uid, int index, boolean rs3)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
click()
Clicks this entity in an interactable pointboolean
contains(java.awt.Point point)
Checks if the projected bounds of this entity contains the Point provided.boolean
equals(java.lang.Object o)
java.util.List<java.lang.String>
getActions()
Attribute
getAttribute(long id)
java.util.List<Attribute>
getAttributes()
int
getBorderThickness()
Deprecated.@Nullable InteractableRectangle
getBounds()
abstract @Nullable InterfaceComponent
getChild(int index)
abstract @Nullable InterfaceComponent
getChild(java.util.function.Predicate<InterfaceComponent> predicate)
int
getChildQuantity()
abstract java.util.List<InterfaceComponent>
getChildren()
java.util.List<InterfaceComponent>
getChildren(java.util.function.Predicate<InterfaceComponent> predicate)
@Nullable InterfaceComponent
getComponent(int index)
Deprecated.int
getComponentQuantity()
Deprecated.java.util.List<InterfaceComponent>
getComponents()
Deprecated.usegetChildren()
instead.java.util.List<InterfaceComponent>
getComponents(java.util.function.Predicate<InterfaceComponent> predicate)
Deprecated.@Nullable ItemDefinition
getContainedItem()
int
getContainedItemId()
abstract int
getContainedItemQuantity()
InterfaceContainer
getContainer()
int
getFontId()
int
getHeight()
int
getId()
int
getIndex()
@Nullable InteractablePoint
getInteractionPoint(java.awt.Point origin)
Gets a point within the entity that can be interacted with.InterfaceComponent
getLayer()
int
getLayerDepth()
int
getLayerId()
java.lang.String
getName()
Gets the name of the interface as shown in the menu@Nullable InterfaceComponent
getParentComponent()
int
getProjectedBufferId()
abstract int
getProjectedEntityAnimationId()
Gets the animation being used to animate the projected entity@Nullable ItemDefinition
getProjectedItem()
Gets the information about the entity being projected and returns it (if it's an Item)@Nullable NpcDefinition
getProjectedNpc()
Gets the information about the entity being projected and returns it (if it's a Player)@Nullable Player
getProjectedPlayer()
Gets the information about the entity being projected and returns it (if it's a Player)java.lang.String[]
getRawActions()
@Nullable java.lang.String
getRawText()
Gets the raw text of an InterfaceComponent with type LABEL or TOOLTIP@Nullable java.awt.Point
getScrollShift()
int
getSpecializationIndicator()
@Nullable java.lang.String
getSpellActionName()
int
getSpriteBorderInset()
@Nullable java.awt.Color
getSpriteFillColor()
int
getSpriteId()
int
getSpriteRotation()
@Nullable java.lang.String
getText()
Gets the text of an InterfaceComponent with type LABEL or TOOLTIP with the "jagtags" (formatting tags) stripped.java.awt.Color
getTextColor()
int
getTextureId()
Deprecated.@Nullable java.lang.String
getTooltip()
Gets the text in the tooltip that appears after hovering the component for a momentInterfaceComponent.Type
getType()
double
getVisibility()
Returns a rough estimate of how visible this entity is as a percent (0 to 100)int
getWidth()
boolean
hasDynamicBounds()
int
hashCode()
boolean
interact(java.lang.String action)
boolean
interact(java.util.regex.Pattern action)
boolean
interact(java.util.regex.Pattern action, java.util.regex.Pattern target)
Attempts to match action and target using Matcher.find() and then interacts with the appropriate menu itemboolean
isValid()
Verifies whether this entity is valid and still exists, typically on the world-graphboolean
isVisible()
Whether the entity is visibleInterfaceComponentQueryBuilder
newQuery()
void
render(java.awt.Graphics2D g2d)
Renders this entity onto the givenGraphics2D
, use is discouragedvoid
render(javafx.scene.canvas.GraphicsContext gc)
Renders this entity onto the givenGraphicsContext
java.lang.String
toString()
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Interactable
getInteractionPoint, hover, interact, interact, interact, isHovered
-
-
-
-
Field Detail
-
container
public final InterfaceContainer container
-
-
Constructor Detail
-
InterfaceComponent
public InterfaceComponent(InterfaceContainer container, long uid, int index, boolean rs3)
-
InterfaceComponent
public InterfaceComponent(InterfaceContainer container, InterfaceComponent parent, long uid, int index, boolean rs3)
-
-
Method Detail
-
getActions
public java.util.List<java.lang.String> getActions()
-
getRawActions
public java.lang.String[] getRawActions()
-
getBorderThickness
@Deprecated public final int getBorderThickness()
Deprecated.
-
getSpellActionName
@Nullable public final @Nullable java.lang.String getSpellActionName()
-
getBounds
@Nullable public final @Nullable InteractableRectangle getBounds()
-
getChildQuantity
public final int getChildQuantity()
-
getComponentQuantity
@Deprecated public final int getComponentQuantity()
Deprecated.
-
getComponent
@Deprecated @Nullable public final @Nullable InterfaceComponent getComponent(int index)
Deprecated.
-
getComponents
@Deprecated public final java.util.List<InterfaceComponent> getComponents()
Deprecated.usegetChildren()
instead.
-
getChild
@Nullable public abstract @Nullable InterfaceComponent getChild(int index)
-
getChild
@Nullable public abstract @Nullable InterfaceComponent getChild(java.util.function.Predicate<InterfaceComponent> predicate)
-
getChildren
public abstract java.util.List<InterfaceComponent> getChildren()
-
getChildren
public final java.util.List<InterfaceComponent> getChildren(java.util.function.Predicate<InterfaceComponent> predicate)
-
getComponents
@Deprecated public final java.util.List<InterfaceComponent> getComponents(java.util.function.Predicate<InterfaceComponent> predicate)
Deprecated.
-
getContainedItem
@Nullable public final @Nullable ItemDefinition getContainedItem()
-
getContainedItemId
public final int getContainedItemId()
-
getContainer
public InterfaceContainer getContainer()
-
getSpecializationIndicator
public final int getSpecializationIndicator()
-
getFontId
public final int getFontId()
-
getHeight
public final int getHeight()
-
getId
public final int getId()
- Specified by:
getId
in interfaceIdentifiable
-
getIndex
public final int getIndex()
-
getLayer
public InterfaceComponent getLayer()
-
getLayerId
public int getLayerId()
-
getLayerDepth
public int getLayerDepth()
-
getName
public final java.lang.String getName()
Gets the name of the interface as shown in the menu
-
getParentComponent
@Nullable public @Nullable InterfaceComponent getParentComponent()
-
getProjectedBufferId
public final int getProjectedBufferId()
-
getContainedItemQuantity
public abstract int getContainedItemQuantity()
-
getProjectedEntityAnimationId
public abstract int getProjectedEntityAnimationId()
Gets the animation being used to animate the projected entity
-
getTooltip
@RS3Only @Nullable public @Nullable java.lang.String getTooltip()
Gets the text in the tooltip that appears after hovering the component for a moment- Returns:
- null if the component doesn't have a tooltip, otherwise a
String
-
getProjectedItem
@Nullable public final @Nullable ItemDefinition getProjectedItem()
Gets the information about the entity being projected and returns it (if it's an Item)
-
getProjectedNpc
@Nullable public final @Nullable NpcDefinition getProjectedNpc()
Gets the information about the entity being projected and returns it (if it's a Player)
-
getProjectedPlayer
@Nullable public final @Nullable Player getProjectedPlayer()
Gets the information about the entity being projected and returns it (if it's a Player)
-
getScrollShift
@Nullable public @Nullable java.awt.Point getScrollShift()
-
getSpriteBorderInset
public final int getSpriteBorderInset()
-
getSpriteFillColor
@Nullable public final @Nullable java.awt.Color getSpriteFillColor()
-
getSpriteId
public final int getSpriteId()
-
getSpriteRotation
public final int getSpriteRotation()
-
getText
@Nullable public final @Nullable java.lang.String getText()
Gets the text of an InterfaceComponent with type LABEL or TOOLTIP with the "jagtags" (formatting tags) stripped.- Returns:
- #getRawText() formatted with JagTags.remove()
-
getRawText
@Nullable public final @Nullable java.lang.String getRawText()
Gets the raw text of an InterfaceComponent with type LABEL or TOOLTIP- Returns:
- a String if the interface component is one of the specified types and it has text, otherwise null.
-
getTextColor
public final java.awt.Color getTextColor()
-
getTextureId
@Deprecated public final int getTextureId()
Deprecated.
-
getType
public final InterfaceComponent.Type getType()
-
getWidth
public final int getWidth()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isValid
public final boolean isValid()
Description copied from interface:Validatable
Verifies whether this entity is valid and still exists, typically on the world-graph- Specified by:
isValid
in interfaceValidatable
- Returns:
- true if it's still available, otherwise false
-
isVisible
public boolean isVisible()
Description copied from interface:Interactable
Whether the entity is visible- Specified by:
isVisible
in interfaceInteractable
- Returns:
- true if visible, and false if not visible
-
getVisibility
public double getVisibility()
Description copied from interface:Interactable
Returns a rough estimate of how visible this entity is as a percent (0 to 100)- Specified by:
getVisibility
in interfaceInteractable
-
hasDynamicBounds
public boolean hasDynamicBounds()
- Specified by:
hasDynamicBounds
in interfaceInteractable
-
getInteractionPoint
@Nullable public final @Nullable InteractablePoint getInteractionPoint(java.awt.Point origin)
Description copied from interface:Interactable
Gets a point within the entity that can be interacted with. Takes into account the direction of movement from the origin point.- Specified by:
getInteractionPoint
in interfaceInteractable
-
contains
public final boolean contains(java.awt.Point point)
Description copied from interface:Interactable
Checks if the projected bounds of this entity contains the Point provided.- Specified by:
contains
in interfaceInteractable
- Returns:
-
click
public final boolean click()
Description copied from interface:Interactable
Clicks this entity in an interactable point- Specified by:
click
in interfaceInteractable
- Returns:
- true if successfully clicked
-
interact
public final boolean interact(java.util.regex.Pattern action, java.util.regex.Pattern target)
Description copied from interface:Interactable
Attempts to match action and target using Matcher.find() and then interacts with the appropriate menu item- Specified by:
interact
in interfaceInteractable
- Parameters:
action
- The pattern to match the action with, if null it's ignoredtarget
- The pattern to match the target with, if null it's ignored
-
interact
public final boolean interact(java.lang.String action)
- Specified by:
interact
in interfaceInteractable
-
interact
public final boolean interact(java.util.regex.Pattern action)
- Specified by:
interact
in interfaceInteractable
-
render
public final void render(java.awt.Graphics2D g2d)
Description copied from interface:Renderable
Renders this entity onto the givenGraphics2D
, use is discouraged- Specified by:
render
in interfaceRenderable
-
render
public void render(javafx.scene.canvas.GraphicsContext gc)
Description copied from interface:Renderable
Renders this entity onto the givenGraphicsContext
- Specified by:
render
in interfaceRenderable
-
newQuery
public InterfaceComponentQueryBuilder newQuery()
-
-