use of net.drewke.tdme.utils.MutableString in project tdme by andreasdr.
the class ModelViewerScreenController method init.
/*
* (non-Javadoc)
* @see net.drewke.tdme.tools.shared.controller.ScreenController#init(net.drewke.tdme.gui.events.GUIActionListener, net.drewke.tdme.gui.events.GUIChangeListener)
*/
public void init() {
// load screen node
try {
screenNode = GUIParser.parse("resources/tools/viewer/gui", "screen_modelviewer.xml");
screenNode.addActionListener(this);
screenNode.addChangeListener(this);
screenCaption = (GUITextNode) screenNode.getNodeById("screen_caption");
modelReload = (GUIElementNode) screenNode.getNodeById("button_model_reload");
modelSave = (GUIElementNode) screenNode.getNodeById("button_model_save");
pivotX = (GUIElementNode) screenNode.getNodeById("pivot_x");
pivotY = (GUIElementNode) screenNode.getNodeById("pivot_y");
pivotZ = (GUIElementNode) screenNode.getNodeById("pivot_z");
pivotApply = (GUIElementNode) screenNode.getNodeById("button_pivot_apply");
statsOpaqueFaces = (GUIElementNode) screenNode.getNodeById("stats_opaque_faces");
statsTransparentFaces = (GUIElementNode) screenNode.getNodeById("stats_transparent_faces");
statsMaterialCount = (GUIElementNode) screenNode.getNodeById("stats_material_count");
statsOpaqueFaces.getController().setDisabled(true);
statsTransparentFaces.getController().setDisabled(true);
statsMaterialCount.getController().setDisabled(true);
} catch (Exception e) {
e.printStackTrace();
}
// init entity base sub screen controller
entityBaseSubScreenController.init(screenNode);
// init display sub screen controller
entityDisplaySubScreenController.init(screenNode);
// init bounding volume sub screen controller
entityBoundingVolumeSubScreenController.init(screenNode);
//
value = new MutableString();
}
use of net.drewke.tdme.utils.MutableString in project tdme by andreasdr.
the class GUISelectBoxMultipleController method init.
/*
* (non-Javadoc)
* @see net.drewke.tdme.gui.GUINodeController#init()
*/
public void init() {
// Focus last selected
if (getFocussedOptionIdx() == -1) {
// could do better here for sure
MutableString value = getValue();
setValue(value);
}
}
use of net.drewke.tdme.utils.MutableString in project tdme by andreasdr.
the class LevelEditorEntityLibraryScreenController method init.
/*
* (non-Javadoc)
* @see net.drewke.tdme.tools.shared.controller.ScreenController#init()
*/
public void init() {
try {
screenNode = GUIParser.parse("resources/tools/leveleditor/gui", "screen_leveleditor_entitylibrary.xml");
screenNode.addActionListener(this);
screenNode.addChangeListener(this);
//
entityLibraryListBox = (GUIElementNode) screenNode.getNodeById("entity_library_listbox");
buttonEntityPlace = (GUIElementNode) screenNode.getNodeById("button_entity_place");
buttonLevelEdit = (GUIElementNode) screenNode.getNodeById("button_level_edit");
} catch (Exception e) {
e.printStackTrace();
}
//
buttonEntityPlace.getController().setDisabled(false);
buttonLevelEdit.getController().setDisabled(true);
//
dropdownEntityActionReset = new MutableString("action");
}
use of net.drewke.tdme.utils.MutableString in project tdme by andreasdr.
the class GUIScreenNode method getValues.
/**
* Get values
* @param values
*/
public void getValues(HashMap<String, MutableString> values) {
// clear values
values.clear();
// determine screen child controller nodes
getChildControllerNodes(childControllerNodes);
// iterate nodes
for (int i = 0; i < childControllerNodes.size(); i++) {
GUINode childControllerNode = childControllerNodes.get(i);
// skip on non element nodes
if (childControllerNode instanceof GUIElementNode == false)
continue;
// cast to element node
GUIElementNode guiElementNode = ((GUIElementNode) childControllerNode);
// get controller
GUINodeController guiElementNodeController = guiElementNode.getController();
// does the controller provides a value
if (guiElementNodeController.hasValue()) {
String name = guiElementNode.getName();
MutableString value = guiElementNodeController.getValue();
MutableString currentValue = values.get(name);
// if not yet set, do it
if (currentValue == null || currentValue.length() == 0) {
values.put(name, value);
}
}
}
}
Aggregations