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);
}
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);
}
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);
}
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();
}
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();
}
}
Aggregations