Search in sources :

Example 6 with GUINodeConditions

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

the class GUIRadioButtonController method select.

/**
	 * Select
	 * @param checked
	 */
protected void select() {
    ArrayList<GUIElementNode> radioButtonGroupNodes = radioButtonGroupNodesByName.get(this.node.getScreenNode().getId() + "_radiobuttongroup_" + ((GUIElementNode) this.node).getName());
    // unselect all radio buttons
    if (radioButtonGroupNodes != null) {
        for (int i = 0; i < radioButtonGroupNodes.size(); i++) {
            GUIElementNode radioButtonNode = radioButtonGroupNodes.get(i);
            GUINodeConditions nodeConditions = radioButtonNode.getActiveConditions();
            GUIRadioButtonController nodeController = (GUIRadioButtonController) radioButtonNode.getController();
            nodeConditions.remove(nodeController.selected == true ? CONDITION_SELECTED : CONDITION_UNSELECTED);
            nodeController.selected = false;
            nodeConditions.add(nodeController.selected == true ? CONDITION_SELECTED : CONDITION_UNSELECTED);
        }
    }
    // 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);
}
Also used : GUINodeConditions(net.drewke.tdme.gui.nodes.GUINodeConditions) GUIElementNode(net.drewke.tdme.gui.nodes.GUIElementNode)

Example 7 with GUINodeConditions

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

the class GUISelectBoxOptionController 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);
    // disabled
    boolean disabled = ((GUISelectBoxController) selectBoxNode.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 8 with GUINodeConditions

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

the class GUISelectBoxOptionController 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 = ((GUISelectBoxController) selectBoxNode.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 9 with GUINodeConditions

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

the class GUITabContentController method setSelected.

/**
	 * Set checked
	 * @param selected
	 */
protected void setSelected(boolean selected) {
    // remove old selection condition, add new selection condition
    GUINodeConditions nodeConditions = ((GUIElementNode) this.node.getParentNode()).getActiveConditions();
    nodeConditions.remove(this.selected == true ? CONDITION_SELECTED : CONDITION_UNSELECTED);
    this.selected = selected;
    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 10 with GUINodeConditions

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

the class GUITabController 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)

Aggregations

GUIElementNode (net.drewke.tdme.gui.nodes.GUIElementNode)20 GUINodeConditions (net.drewke.tdme.gui.nodes.GUINodeConditions)20 GUIColor (net.drewke.tdme.gui.nodes.GUIColor)1 GUINode (net.drewke.tdme.gui.nodes.GUINode)1 GUITextNode (net.drewke.tdme.gui.nodes.GUITextNode)1