Search in sources :

Example 21 with GUIElementNode

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

the class GUIDropDownOptionController method unselect.

/**
	 * Unselect
	 * @param checked
	 */
protected void unselect() {
    // unselect current
    GUINodeConditions nodeConditions = ((GUIElementNode) node).getActiveConditions();
    nodeConditions.remove(this.selected == true ? CONDITION_SELECTED : CONDITION_UNSELECTED);
    this.selected = false;
    nodeConditions.add(this.selected == true ? CONDITION_SELECTED : CONDITION_UNSELECTED);
}
Also used : GUINodeConditions(net.drewke.tdme.gui.nodes.GUINodeConditions) GUIElementNode(net.drewke.tdme.gui.nodes.GUIElementNode)

Example 22 with GUIElementNode

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

the class GUIInputController method setDisabled.

/*
	 * (non-Javadoc)
	 * @see net.drewke.tdme.gui.nodes.GUINodeController#setDisabled(boolean)
	 */
public void setDisabled(boolean disabled) {
    GUINodeConditions nodeConditions = ((GUIElementNode) node).getActiveConditions();
    nodeConditions.remove(this.disabled == true ? CONDITION_DISABLED : CONDITION_ENABLED);
    this.disabled = disabled;
    nodeConditions.add(this.disabled == true ? CONDITION_DISABLED : CONDITION_ENABLED);
}
Also used : GUINodeConditions(net.drewke.tdme.gui.nodes.GUINodeConditions) GUIElementNode(net.drewke.tdme.gui.nodes.GUIElementNode)

Example 23 with GUIElementNode

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

the class GUISelectBoxMultipleOptionController method select.

/**
	 * Select
	 */
protected void select() {
    // select current
    GUINodeConditions nodeConditions = ((GUIElementNode) node).getActiveConditions();
    nodeConditions.remove(this.selected == true ? CONDITION_SELECTED : CONDITION_UNSELECTED);
    this.selected = true;
    nodeConditions.add(this.selected == true ? CONDITION_SELECTED : CONDITION_UNSELECTED);
    // disabled
    boolean disabled = ((GUISelectBoxMultipleController) selectBoxMultipleNode.getController()).isDisabled();
    nodeConditions.remove(CONDITION_DISABLED);
    nodeConditions.remove(CONDITION_ENABLED);
    nodeConditions.add(disabled == true ? CONDITION_DISABLED : CONDITION_ENABLED);
}
Also used : GUINodeConditions(net.drewke.tdme.gui.nodes.GUINodeConditions) GUIElementNode(net.drewke.tdme.gui.nodes.GUIElementNode)

Example 24 with GUIElementNode

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

the class GUISelectBoxController method setDisabled.

/*
	 * (non-Javadoc)
	 * @see net.drewke.tdme.gui.nodes.GUINodeController#setDisabled(boolean)
	 */
public void setDisabled(boolean disabled) {
    GUINodeConditions nodeConditions = ((GUIElementNode) node).getActiveConditions();
    nodeConditions.remove(this.disabled == true ? CONDITION_DISABLED : CONDITION_ENABLED);
    this.disabled = disabled;
    nodeConditions.add(this.disabled == true ? CONDITION_DISABLED : CONDITION_ENABLED);
    //
    selectCurrent();
}
Also used : GUINodeConditions(net.drewke.tdme.gui.nodes.GUINodeConditions) GUIElementNode(net.drewke.tdme.gui.nodes.GUIElementNode)

Example 25 with GUIElementNode

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

the class GUISelectBoxMultipleController method setValue.

/*
	 * (non-Javadoc)
	 * @see net.drewke.tdme.gui.nodes.GUINodeController#setValue(net.drewke.tdme.utils.MutableString)
	 */
public void setValue(MutableString value) {
    // determine select box option controllers
    determineSelectBoxMultipleOptionControllers();
    // unselect all selections
    unselect();
    unfocus();
    // determine new selection
    GUIElementNode selectBoxOptionNodeLast = null;
    for (int i = 0; i < selectBoxMultipleOptionControllers.size(); i++) {
        GUISelectBoxMultipleOptionController selectBoxOptionController = selectBoxMultipleOptionControllers.get(i);
        GUIElementNode selectBoxOptionNode = (GUIElementNode) selectBoxOptionController.getNode();
        // set up value we search for
        searchValue.reset();
        searchValue.append(VALUE_DELIMITER);
        searchValue.append(selectBoxOptionNode.getValue());
        searchValue.append(VALUE_DELIMITER);
        // check if value
        if (value.indexOf(searchValue) != -1) {
            selectBoxOptionController.select();
            selectBoxOptionNode.scrollToNodeX((GUIParentNode) node);
            selectBoxOptionNode.scrollToNodeY((GUIParentNode) node);
            selectBoxOptionNodeLast = selectBoxOptionNode;
        }
    }
    // select last node in viewport
    if (selectBoxOptionNodeLast != null) {
        ((GUISelectBoxMultipleOptionController) selectBoxOptionNodeLast.getController()).focus();
    }
}
Also used : GUIElementNode(net.drewke.tdme.gui.nodes.GUIElementNode)

Aggregations

GUIElementNode (net.drewke.tdme.gui.nodes.GUIElementNode)28 GUINodeConditions (net.drewke.tdme.gui.nodes.GUINodeConditions)20 GUIParentNode (net.drewke.tdme.gui.nodes.GUIParentNode)5 GUIActionListener (net.drewke.tdme.gui.events.GUIActionListener)4 GUIColor (net.drewke.tdme.gui.nodes.GUIColor)2 GUINode (net.drewke.tdme.gui.nodes.GUINode)2 GUITextNode (net.drewke.tdme.gui.nodes.GUITextNode)2 MutableString (net.drewke.tdme.utils.MutableString)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 DocumentBuilder (javax.xml.parsers.DocumentBuilder)1 GUIColorEffect (net.drewke.tdme.gui.effects.GUIColorEffect)1 GUIPositionEffect (net.drewke.tdme.gui.effects.GUIPositionEffect)1 GUIElement (net.drewke.tdme.gui.elements.GUIElement)1 GUITabController (net.drewke.tdme.gui.elements.GUITabController)1 GUIChangeListener (net.drewke.tdme.gui.events.GUIChangeListener)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 GUINodeController (net.drewke.tdme.gui.nodes.GUINodeController)1