Search in sources :

Example 6 with MutableString

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();
}
Also used : MutableString(net.drewke.tdme.utils.MutableString)

Example 7 with 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);
    }
}
Also used : MutableString(net.drewke.tdme.utils.MutableString)

Example 8 with MutableString

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");
}
Also used : MutableString(net.drewke.tdme.utils.MutableString)

Example 9 with MutableString

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);
            }
        }
    }
}
Also used : MutableString(net.drewke.tdme.utils.MutableString) MutableString(net.drewke.tdme.utils.MutableString)

Aggregations

MutableString (net.drewke.tdme.utils.MutableString)9 GUIElementNode (net.drewke.tdme.gui.nodes.GUIElementNode)2 GUIParentNode (net.drewke.tdme.gui.nodes.GUIParentNode)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 DocumentBuilder (javax.xml.parsers.DocumentBuilder)1 GUIColorEffect (net.drewke.tdme.gui.effects.GUIColorEffect)1 GUIPositionEffect (net.drewke.tdme.gui.effects.GUIPositionEffect)1 GUIElement (net.drewke.tdme.gui.elements.GUIElement)1 GUITabController (net.drewke.tdme.gui.elements.GUITabController)1 GUIActionListener (net.drewke.tdme.gui.events.GUIActionListener)1 GUIChangeListener (net.drewke.tdme.gui.events.GUIChangeListener)1 GUIColor (net.drewke.tdme.gui.nodes.GUIColor)1 GUIHorizontalScrollbarInternalNode (net.drewke.tdme.gui.nodes.GUIHorizontalScrollbarInternalNode)1 GUIImageNode (net.drewke.tdme.gui.nodes.GUIImageNode)1 GUIInputInternalNode (net.drewke.tdme.gui.nodes.GUIInputInternalNode)1 GUILayoutNode (net.drewke.tdme.gui.nodes.GUILayoutNode)1 GUINode (net.drewke.tdme.gui.nodes.GUINode)1 GUINodeController (net.drewke.tdme.gui.nodes.GUINodeController)1 GUIPanelNode (net.drewke.tdme.gui.nodes.GUIPanelNode)1 GUIScreenNode (net.drewke.tdme.gui.nodes.GUIScreenNode)1