Search in sources :

Example 1 with GUINode

use of net.drewke.tdme.gui.nodes.GUINode in project tdme by andreasdr.

the class GUISelectBoxMultipleController method determineSelectBoxMultipleOptionControllers.

/**
	 * Determine select box option controllers
	 */
private void determineSelectBoxMultipleOptionControllers() {
    selectBoxMultipleOptionControllers.clear();
    ((GUIParentNode) node).getChildControllerNodes(childControllerNodes);
    for (int i = 0; i < childControllerNodes.size(); i++) {
        GUINode childControllerNode = childControllerNodes.get(i);
        GUINodeController childController = childControllerNode.getController();
        if (childController instanceof GUISelectBoxMultipleOptionController) {
            selectBoxMultipleOptionControllers.add((GUISelectBoxMultipleOptionController) childController);
        }
    }
}
Also used : GUIParentNode(net.drewke.tdme.gui.nodes.GUIParentNode) GUINodeController(net.drewke.tdme.gui.nodes.GUINodeController) GUINode(net.drewke.tdme.gui.nodes.GUINode)

Example 2 with GUINode

use of net.drewke.tdme.gui.nodes.GUINode in project tdme by andreasdr.

the class GUISelectBoxMultipleController method unfocus.

/**
	 * Unfocus all nodes
	 */
protected void unfocus() {
    ((GUIParentNode) node).getChildControllerNodes(childControllerNodes);
    for (int i = 0; i < childControllerNodes.size(); i++) {
        GUINode childControllerNode = childControllerNodes.get(i);
        GUINodeController childController = childControllerNode.getController();
        if (childController instanceof GUISelectBoxMultipleOptionController) {
            ((GUISelectBoxMultipleOptionController) childController).unfocus();
        }
    }
}
Also used : GUIParentNode(net.drewke.tdme.gui.nodes.GUIParentNode) GUINodeController(net.drewke.tdme.gui.nodes.GUINodeController) GUINode(net.drewke.tdme.gui.nodes.GUINode)

Example 3 with GUINode

use of net.drewke.tdme.gui.nodes.GUINode in project tdme by andreasdr.

the class GUISelectBoxController method determineSelectBoxOptionControllers.

/**
	 * Determine select box option controllers
	 */
private void determineSelectBoxOptionControllers() {
    selectBoxOptionControllers.clear();
    ((GUIParentNode) node).getChildControllerNodes(childControllerNodes);
    for (int i = 0; i < childControllerNodes.size(); i++) {
        GUINode childControllerNode = childControllerNodes.get(i);
        GUINodeController childController = childControllerNode.getController();
        if (childController instanceof GUISelectBoxOptionController) {
            selectBoxOptionControllers.add((GUISelectBoxOptionController) childController);
        }
    }
}
Also used : GUIParentNode(net.drewke.tdme.gui.nodes.GUIParentNode) GUINodeController(net.drewke.tdme.gui.nodes.GUINodeController) GUINode(net.drewke.tdme.gui.nodes.GUINode)

Example 4 with GUINode

use of net.drewke.tdme.gui.nodes.GUINode in project tdme by andreasdr.

the class GUI method handleEvents.

/**
	 * Handle screen events
	 */
public void handleEvents() {
    // lock
    lockEvents();
    // handle floating nodes of screens first
    for (int i = renderScreens.size() - 1; i >= 0; i--) {
        // screen
        GUIScreenNode screen = renderScreens.get(i);
        if (screen.isVisible() == false)
            continue;
        // floating nodes
        ArrayList<GUINode> floatingNodes = screen.getFloatingNodes();
        for (int j = 0; j < floatingNodes.size(); j++) {
            // floating node
            GUINode floatingNode = floatingNodes.get(j);
            // handle it events
            handleEvents(floatingNode);
        }
        // break here if pop up
        if (screen.isPopUp() == true)
            break;
    }
    // handle screen input events
    for (int i = renderScreens.size() - 1; i >= 0; i--) {
        // screen
        GUIScreenNode screen = renderScreens.get(i);
        if (screen.isVisible() == false)
            continue;
        // handle screen events
        handleEvents(screen);
        // events handler
        if (screen.getInputEventHandler() != null) {
            screen.getInputEventHandler().handleInputEvents();
        }
        // break here if pop up
        if (screen.isPopUp() == true)
            break;
    }
    // discard events
    mouseEvents.clear();
    mouseEventsPool.reset();
    keyboardEvents.clear();
    keyboardEventsPool.reset();
    // unlock
    unlockEvents();
}
Also used : GUIScreenNode(net.drewke.tdme.gui.nodes.GUIScreenNode) GUINode(net.drewke.tdme.gui.nodes.GUINode)

Example 5 with GUINode

use of net.drewke.tdme.gui.nodes.GUINode in project tdme by andreasdr.

the class GUITabsController method unselect.

/**
	 * Unselect all tab nodes
	 */
protected void unselect() {
    // unselect tabs (header)
    ((GUIParentNode) node).getChildControllerNodes(childControllerNodes);
    for (int i = 0; i < childControllerNodes.size(); i++) {
        GUINode childControllerNode = childControllerNodes.get(i);
        GUINodeController childController = childControllerNode.getController();
        if (childController instanceof GUITabController) {
            GUITabController tabController = (GUITabController) childController;
            if (tabController.getNode().getParentControllerNode().getParentControllerNode() != node)
                continue;
            tabController.setSelected(false);
        }
    }
}
Also used : GUIParentNode(net.drewke.tdme.gui.nodes.GUIParentNode) GUINodeController(net.drewke.tdme.gui.nodes.GUINodeController) GUINode(net.drewke.tdme.gui.nodes.GUINode)

Aggregations

GUINode (net.drewke.tdme.gui.nodes.GUINode)13 GUINodeController (net.drewke.tdme.gui.nodes.GUINodeController)12 GUIParentNode (net.drewke.tdme.gui.nodes.GUIParentNode)12 GUIScreenNode (net.drewke.tdme.gui.nodes.GUIScreenNode)1