Search in sources :

Example 1 with Widget

use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.

the class Component method getInternalComponent.

private Widget getInternalComponent() {
    if (index < 0 || widget.id() < 1) {
        return null;
    }
    final Object[] components;
    if (parent != null) {
        final Widget parentComponent = parent.getInternalComponent();
        components = parentComponent != null ? parentComponent.getComponents() : null;
    } else {
        components = widget.getInternalComponents();
    }
    final Client c = ctx.client();
    return c != null && components != null && index < components.length ? new Widget(c.reflector, components[index]) : null;
}
Also used : Widget(org.powerbot.bot.rt6.client.Widget) Client(org.powerbot.bot.rt6.client.Client)

Example 2 with Widget

use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.

the class Component method childrenCount.

public int childrenCount() {
    final Widget component = getInternalComponent();
    final Object[] interfaces;
    if (component != null && (interfaces = component.getComponents()) != null) {
        return interfaces.length;
    }
    return 0;
}
Also used : Widget(org.powerbot.bot.rt6.client.Widget)

Example 3 with Widget

use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.

the class Component method _visible.

private boolean _visible(final int depth) {
    if (depth > RECURSION_DEPTH) {
        System.out.printf("WARNING: Visible operation killed -- beyond depth of %d.%n", RECURSION_DEPTH);
        return false;
    }
    final Widget internal = getInternalComponent();
    int id = 0;
    if (internal != null && valid() && !internal.isHidden()) {
        id = parentId();
    }
    return id == -1 || (id != 0 && ctx.widgets.component(id >> 16, id & 0xffff)._visible(depth + 1));
}
Also used : Widget(org.powerbot.bot.rt6.client.Widget) Point(java.awt.Point)

Example 4 with Widget

use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.

the class Component method itemName.

public String itemName() {
    final Widget component = getInternalComponent();
    String name = "";
    if (component != null && (name = component.getComponentName()) == null) {
        name = "";
    }
    return StringUtils.stripHtml(name);
}
Also used : Widget(org.powerbot.bot.rt6.client.Widget)

Example 5 with Widget

use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.

the class Component method selectedAction.

public String selectedAction() {
    final Widget component = getInternalComponent();
    String action = "";
    if (component != null && (action = component.getSelectedActionName()) == null) {
        action = "";
    }
    return action;
}
Also used : Widget(org.powerbot.bot.rt6.client.Widget)

Aggregations

Widget (org.powerbot.bot.rt6.client.Widget)11 Point (java.awt.Point)5 Client (org.powerbot.bot.rt6.client.Client)4 Rectangle (java.awt.Rectangle)1 ArrayList (java.util.ArrayList)1 HashTable (org.powerbot.bot.rt6.HashTable)1 ComponentNode (org.powerbot.bot.rt6.client.ComponentNode)1