use of net.drewke.tdme.gui.nodes.GUIElementNode in project tdme by andreasdr.
the class GUISelectBoxMultipleOptionController method focus.
/**
* Focus
*/
protected void focus() {
// select current
GUINodeConditions nodeConditions = ((GUIElementNode) node).getActiveConditions();
nodeConditions.remove(this.focussed == true ? CONDITION_FOCUSSED : CONDITION_UNFOCUSSED);
this.focussed = true;
nodeConditions.add(this.focussed == true ? CONDITION_FOCUSSED : CONDITION_UNFOCUSSED);
}
use of net.drewke.tdme.gui.nodes.GUIElementNode in project tdme by andreasdr.
the class GUISelectBoxController 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
determineSelectBoxOptionControllers();
// unselect all selections
unselect();
// determine new selection
for (int i = 0; i < selectBoxOptionControllers.size(); i++) {
GUISelectBoxOptionController selectBoxOptionController = selectBoxOptionControllers.get(i);
GUIElementNode selectBoxOptionNode = (GUIElementNode) selectBoxOptionController.getNode();
if (value.equals(selectBoxOptionNode.getValue()) == true) {
selectBoxOptionController.select();
selectBoxOptionNode.scrollToNodeX((GUIParentNode) node);
selectBoxOptionNode.scrollToNodeY((GUIParentNode) node);
break;
}
}
}
use of net.drewke.tdme.gui.nodes.GUIElementNode in project tdme by andreasdr.
the class GUIRadioButtonController 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);
}
use of net.drewke.tdme.gui.nodes.GUIElementNode 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);
}
use of net.drewke.tdme.gui.nodes.GUIElementNode 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);
}
Aggregations