Search in sources :

Example 11 with GUINodeConditions

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

the class GUITabController method setSelected.

/**
	 * Set checked
	 * @param selected
	 */
protected void setSelected(boolean selected) {
    // remove old selection condition, add new selection condition
    GUINodeConditions nodeConditions = ((GUIElementNode) this.node).getActiveConditions();
    nodeConditions.remove(this.selected == true ? CONDITION_SELECTED : CONDITION_UNSELECTED);
    this.selected = selected;
    nodeConditions.add(this.selected == true ? CONDITION_SELECTED : CONDITION_UNSELECTED);
    // handle focus, alter border depending on tabs header node focus and selection state
    if (((GUITabsHeaderController) tabsHeaderNode.getController()).hasFocus() == true) {
        if (selected == true) {
            GUIColor focussedBorderColor = node.getScreenNode().getGUI().getFoccussedBorderColor();
            GUINode.Border border = node.getBorder();
            border.topColor = focussedBorderColor;
            border.leftColor = focussedBorderColor;
            border.bottomColor = focussedBorderColor;
            border.rightColor = focussedBorderColor;
        } else {
            GUINode.Border border = node.getBorder();
            border.topColor = unfocussedNodeBorderTopColor;
            border.leftColor = unfocussedNodeBorderLeftColor;
            border.bottomColor = unfocussedNodeBorderBottomColor;
            border.rightColor = unfocussedNodeBorderRightColor;
        }
    } else {
        GUINode.Border border = node.getBorder();
        border.topColor = unfocussedNodeBorderTopColor;
        border.leftColor = unfocussedNodeBorderLeftColor;
        border.bottomColor = unfocussedNodeBorderBottomColor;
        border.rightColor = unfocussedNodeBorderRightColor;
    }
}
Also used : GUINodeConditions(net.drewke.tdme.gui.nodes.GUINodeConditions) GUIColor(net.drewke.tdme.gui.nodes.GUIColor) GUIElementNode(net.drewke.tdme.gui.nodes.GUIElementNode) GUINode(net.drewke.tdme.gui.nodes.GUINode)

Example 12 with GUINodeConditions

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

the class GUIRadioButtonController method init.

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

Example 13 with GUINodeConditions

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

the class GUIDropDownController method setDisabled.

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

Example 14 with GUINodeConditions

use of net.drewke.tdme.gui.nodes.GUINodeConditions 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 15 with GUINodeConditions

use of net.drewke.tdme.gui.nodes.GUINodeConditions 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)

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