Search in sources :

Example 6 with GUINodeController

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

the class GUITabsController method setTabContentSelected.

/**
	 * Set tab content selected
	 * @param id
	 */
protected void setTabContentSelected(String id) {
    tabContentNodeId.set(id).append("-content");
    // select selected content tab, unselect other content tabs
    ((GUIParentNode) node).getChildControllerNodes(childControllerNodes);
    for (int i = 0; i < childControllerNodes.size(); i++) {
        GUINode childControllerNode = childControllerNodes.get(i);
        GUINodeController childController = childControllerNode.getController();
        if (childController instanceof GUITabContentController) {
            GUITabContentController tabContentController = (GUITabContentController) childController;
            if (tabContentController.getNode().getParentControllerNode().getParentControllerNode() != node)
                continue;
            ((GUITabContentController) childController).setSelected(tabContentNodeId.equals(childController.getNode().getId()));
        }
    }
}
Also used : GUIParentNode(net.drewke.tdme.gui.nodes.GUIParentNode) GUINodeController(net.drewke.tdme.gui.nodes.GUINodeController) GUINode(net.drewke.tdme.gui.nodes.GUINode)

Example 7 with GUINodeController

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

the class GUITabsHeaderController method determineTabControllers.

/**
	 * Determine select box option controllers
	 */
private void determineTabControllers() {
    tabControllers.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 GUITabController) {
            GUITabController guiTabController = (GUITabController) childController;
            if (guiTabController.getNode().getParentControllerNode() != node)
                continue;
            if (guiTabController.isDisabled() == true)
                continue;
            tabControllers.add(guiTabController);
        }
    }
}
Also used : GUIParentNode(net.drewke.tdme.gui.nodes.GUIParentNode) GUINodeController(net.drewke.tdme.gui.nodes.GUINodeController) GUINode(net.drewke.tdme.gui.nodes.GUINode)

Example 8 with GUINodeController

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

the class GUITabsHeaderController method unselect.

/**
	 * Unselect all nodes
	 */
protected void unselect() {
    ((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 guiTabController = (GUITabController) childController;
            if (guiTabController.getNode().getParentControllerNode() != node)
                continue;
            guiTabController.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)

Example 9 with GUINodeController

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

the class GUITabsController method init.

/*
	 * (non-Javadoc)
	 * @see net.drewke.tdme.gui.GUINodeController#init()
	 */
public void init() {
    // child nodes
    ((GUIParentNode) node).getChildControllerNodes(childControllerNodes);
    // select first tab in header
    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(true);
            setTabContentSelected(tabController.getNode().getId());
            break;
        }
    }
}
Also used : GUIParentNode(net.drewke.tdme.gui.nodes.GUIParentNode) GUINodeController(net.drewke.tdme.gui.nodes.GUINodeController) GUINode(net.drewke.tdme.gui.nodes.GUINode)

Example 10 with GUINodeController

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

the class GUIDropDownController method unselect.

/**
	 * Unselect all nodes
	 */
protected void unselect() {
    ((GUIParentNode) node).getChildControllerNodes(childControllerNodes);
    for (int i = 0; i < childControllerNodes.size(); i++) {
        GUINode childControllerNode = childControllerNodes.get(i);
        GUINodeController childController = childControllerNode.getController();
        if (childController instanceof GUIDropDownOptionController) {
            ((GUIDropDownOptionController) childController).unselect();
        }
    }
}
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)13 GUIParentNode (net.drewke.tdme.gui.nodes.GUIParentNode)13 ByteArrayInputStream (java.io.ByteArrayInputStream)1 DocumentBuilder (javax.xml.parsers.DocumentBuilder)1 GUIElement (net.drewke.tdme.gui.elements.GUIElement)1 GUIColor (net.drewke.tdme.gui.nodes.GUIColor)1 GUIElementNode (net.drewke.tdme.gui.nodes.GUIElementNode)1 GUIHorizontalScrollbarInternalNode (net.drewke.tdme.gui.nodes.GUIHorizontalScrollbarInternalNode)1 GUIImageNode (net.drewke.tdme.gui.nodes.GUIImageNode)1 GUIInputInternalNode (net.drewke.tdme.gui.nodes.GUIInputInternalNode)1 GUILayoutNode (net.drewke.tdme.gui.nodes.GUILayoutNode)1 GUIPanelNode (net.drewke.tdme.gui.nodes.GUIPanelNode)1 GUIScreenNode (net.drewke.tdme.gui.nodes.GUIScreenNode)1 GUISpaceNode (net.drewke.tdme.gui.nodes.GUISpaceNode)1 GUITextNode (net.drewke.tdme.gui.nodes.GUITextNode)1 GUIVerticalScrollbarInternalNode (net.drewke.tdme.gui.nodes.GUIVerticalScrollbarInternalNode)1 MutableString (net.drewke.tdme.utils.MutableString)1 Document (org.w3c.dom.Document)1 Element (org.w3c.dom.Element)1