OSDN Git Service

* Added stereo 3D to AppSettings
authorShadowIsLord@gmail.com <ShadowIsLord@gmail.com@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Tue, 5 Jul 2011 14:14:11 +0000 (14:14 +0000)
committerShadowIsLord@gmail.com <ShadowIsLord@gmail.com@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Tue, 5 Jul 2011 14:14:11 +0000 (14:14 +0000)
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@7822 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

engine/src/core/com/jme3/system/AppSettings.java

index d308c87..0cbc9bf 100644 (file)
-/*\r
- * Copyright (c) 2009-2010 jMonkeyEngine\r
- * All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are\r
- * met:\r
- *\r
- * * Redistributions of source code must retain the above copyright\r
- *   notice, this list of conditions and the following disclaimer.\r
- *\r
- * * Redistributions in binary form must reproduce the above copyright\r
- *   notice, this list of conditions and the following disclaimer in the\r
- *   documentation and/or other materials provided with the distribution.\r
- *\r
- * * Neither the name of 'jMonkeyEngine' nor the names of its contributors\r
- *   may be used to endorse or promote products derived from this software\r
- *   without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\r
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\r
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-package com.jme3.system;\r
-\r
-import com.jme3.renderer.Renderer;\r
-import java.io.IOException;\r
-import java.io.InputStream;\r
-import java.io.OutputStream;\r
-import java.io.UnsupportedEncodingException;\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-import java.util.Properties;\r
-import java.util.prefs.BackingStoreException;\r
-import java.util.prefs.Preferences;\r
-\r
-public class AppSettings extends HashMap<String, Object> {\r
-\r
-    private static final AppSettings defaults = new AppSettings(false);\r
-    public static final String LWJGL_OPENGL1 = "LWJGL-OPENGL1",\r
-                               LWJGL_OPENGL2 = "LWJGL-OpenGL2",\r
-                               LWJGL_OPENGL3 = "LWJGL-OpenGL3",\r
-                               LWJGL_OPENGL_ANY = "LWJGL-OpenGL-Any",\r
-                               JOGL = "JOGL",\r
-                               NULL = "NULL";\r
-    public static final String LWJGL_OPENAL = "LWJGL";\r
-    private String settingsDialogImage = "/com/jme3/app/Monkey.png";\r
-\r
-    static {\r
-        defaults.put("Width", 640);\r
-        defaults.put("Height", 480);\r
-        defaults.put("BitsPerPixel", 24);\r
-        defaults.put("Frequency", 60);\r
-        defaults.put("DepthBits", 24);\r
-        defaults.put("StencilBits", 0);\r
-        defaults.put("Samples", 0);\r
-        defaults.put("Fullscreen", false);\r
-        defaults.put("Title", "jMonkey Engine 3.0");\r
-        defaults.put("Renderer", LWJGL_OPENGL2);\r
-        defaults.put("AudioRenderer", LWJGL_OPENAL);\r
-        defaults.put("DisableJoysticks", true);\r
-        defaults.put("UseInput", true);\r
-        defaults.put("VSync", false);\r
-        defaults.put("FrameRate", -1);\r
-      //  defaults.put("Icons", null);\r
-\r
-        // disable these settings to benchmark speed\r
-//        defaults.put("VSync", true);\r
-//        defaults.put("FrameRate", 60);\r
-    }\r
-\r
-    /**\r
-     * Create Application settings\r
-     * use loadDefault=true, to load jME default values.\r
-     * use false if you want to change some settings but you would like the application to remind other settings from previous launches\r
-     * @param loadDefaults\r
-     */\r
-    public AppSettings(boolean loadDefaults) {\r
-        if (loadDefaults) {\r
-            putAll(defaults);\r
-        }\r
-    }\r
-\r
-    public void copyFrom(AppSettings other) {\r
-        this.putAll(other);\r
-    }\r
-\r
-    public void mergeFrom(AppSettings other) {\r
-        for (String key : other.keySet()) {\r
-            if (get(key) == null) {\r
-                put(key, other.get(key));\r
-            }\r
-        }\r
-    }\r
-\r
-    public void load(InputStream in) throws IOException {\r
-        Properties props = new Properties();\r
-        props.load(in);\r
-        for (Map.Entry<Object, Object> entry : props.entrySet()) {\r
-            String key = (String) entry.getKey();\r
-            String val = (String) entry.getValue();\r
-            if (val != null) {\r
-                val = val.trim();\r
-            }\r
-            if (key.endsWith("(int)")) {\r
-                key = key.substring(0, key.length() - 5);\r
-                int iVal = Integer.parseInt(val);\r
-                putInteger(key, iVal);\r
-            } else if (key.endsWith("(string)")) {\r
-                putString(key.substring(0, key.length() - 8), val);\r
-            } else if (key.endsWith("(bool)")) {\r
-                boolean bVal = Boolean.parseBoolean(val);\r
-                putBoolean(key.substring(0, key.length() - 6), bVal);\r
-            } else {\r
-                throw new IOException("Cannot parse key: " + key);\r
-            }\r
-        }\r
-    }\r
-\r
-    public void save(OutputStream out) throws IOException {\r
-        Properties props = new Properties();\r
-        for (Map.Entry<String, Object> entry : entrySet()) {\r
-            Object val = entry.getValue();\r
-            String type;\r
-            if (val instanceof Integer) {\r
-                type = "(int)";\r
-            } else if (val instanceof String) {\r
-                type = "(string)";\r
-            } else if (val instanceof Boolean) {\r
-                type = "(bool)";\r
-            } else {\r
-                throw new UnsupportedEncodingException();\r
-            }\r
-            props.setProperty(entry.getKey() + type, val.toString());\r
-        }\r
-        props.store(out, "jME3 AppSettings");\r
-    }\r
-\r
-    public void load(String preferencesKey) throws BackingStoreException {\r
-        Preferences prefs = Preferences.userRoot().node(preferencesKey);\r
-        String[] keys = prefs.keys();\r
-        if (keys != null) {\r
-            for (String key : keys) {\r
-                Object defaultValue = defaults.get(key);\r
-                if (defaultValue instanceof Integer) {\r
-                    put(key, prefs.getInt(key, (Integer) defaultValue));\r
-                } else if (defaultValue instanceof String) {\r
-                    put(key, prefs.get(key, (String) defaultValue));\r
-                } else if (defaultValue instanceof Boolean) {\r
-                    put(key, prefs.getBoolean(key, (Boolean) defaultValue));\r
-                }\r
-            }\r
-        }\r
-    }\r
-\r
-    public void save(String preferencesKey) throws BackingStoreException {\r
-        Preferences prefs = Preferences.userRoot().node(preferencesKey);\r
-        for (String key : keySet()) {         \r
-            prefs.put(key, get(key).toString());\r
-        }\r
-    }\r
-\r
-    public int getInteger(String key) {\r
-        Integer i = (Integer) get(key);\r
-        if (i == null) {\r
-            return 0;\r
-        }\r
-\r
-        return i.intValue();\r
-    }\r
-\r
-    public boolean getBoolean(String key) {\r
-        Boolean b = (Boolean) get(key);\r
-        if (b == null) {\r
-            return false;\r
-        }\r
-\r
-        return b.booleanValue();\r
-    }\r
-\r
-    public String getString(String key) {\r
-        String s = (String) get(key);\r
-        if (s == null) {\r
-            return null;\r
-        }\r
-\r
-        return s;\r
-    }\r
-\r
-    public void putInteger(String key, int value) {\r
-        put(key, Integer.valueOf(value));\r
-    }\r
-\r
-    public void putBoolean(String key, boolean value) {\r
-        put(key, Boolean.valueOf(value));\r
-    }\r
-\r
-    public void putString(String key, String value) {\r
-        put(key, value);\r
-    }\r
-\r
-    /**\r
-     * @param frameRate The frame-rate is the upper limit on how high\r
-     * the application's frames-per-second can go.\r
-     * (Default: -1 no frame rate limit imposed)\r
-     */\r
-    public void setFrameRate(int frameRate) {\r
-        putInteger("FrameRate", frameRate);\r
-    }\r
-\r
-    /**\r
-     * @param use If true, the application will initialize and use input.\r
-     * Set to false for headless applications that do not require keyboard\r
-     * or mouse input.\r
-     * (Default: true)\r
-     */\r
-    public void setUseInput(boolean use) {\r
-        putBoolean("UseInput", use);\r
-    }\r
-\r
-    /**\r
-     * @param use If true, the application will initialize and use joystick\r
-     * input. Set to false if no joystick input is desired.\r
-     * (Default: false)\r
-     */\r
-    public void setUseJoysticks(boolean use) {\r
-        putBoolean("DisableJoysticks", !use);\r
-    }\r
-\r
-    /**\r
-     * Set the graphics renderer to use, one of:<br>\r
-     * <ul>\r
-     * <li>AppSettings.LWJGL_OPENGL1 - Force OpenGL1.1 compatability</li>\r
-     * <li>AppSettings.LWJGL_OPENGL2 - Force OpenGL2 compatability</li>\r
-     * <li>AppSettings.LWJGL_OPENGL3 - Force OpenGL3.3 compatability</li>\r
-     * <li>AppSettings.LWJGL_OPENGL_ANY - Choose an appropriate \r
-     * OpenGL version based on system capabilities</li>\r
-     * <li>null - Disable graphics rendering</li>\r
-     * </ul>\r
-     * @param renderer The renderer to set\r
-     * (Default: AppSettings.LWJGL_OPENGL2)\r
-     */\r
-    public void setRenderer(String renderer) {\r
-        putString("Renderer", renderer);\r
-    }\r
-\r
-    /**\r
-     * Set a custom graphics renderer to use. The class should implement \r
-     * the {@link Renderer} interface.\r
-     * @param clazz The custom graphics renderer class.\r
-     * (Default: not set)\r
-     */\r
-    public void setCustomRenderer(Class clazz){\r
-        put("Renderer", "CUSTOM" + clazz.getName());\r
-    }\r
-\r
-    /**\r
-     * Set the audio renderer to use. One of:<br>\r
-     * <ul>\r
-     * <li>AppSettings.LWJGL_OPENAL - Default for LWJGL</li>\r
-     * <li>null - Disable audio</li>\r
-     * </ul>\r
-     * @param audioRenderer \r
-     * (Default: LWJGL)\r
-     */\r
-    public void setAudioRenderer(String audioRenderer) {\r
-        putString("AudioRenderer", audioRenderer);\r
-    }\r
-\r
-    /**\r
-     * @param value the width for the rendering display.\r
-     * (Default: 640)\r
-     */\r
-    public void setWidth(int value) {\r
-        putInteger("Width", value);\r
-    }\r
-\r
-    /**\r
-     * @param value the height for the rendering display.\r
-     * (Default: 480)\r
-     */\r
-    public void setHeight(int value) {\r
-        putInteger("Height", value);\r
-    }\r
-\r
-    /**\r
-     * Set the resolution for the rendering display\r
-     * @param width The width\r
-     * @param height The height\r
-     * (Default: 640x480)\r
-     */\r
-    public void setResolution(int width, int height) {\r
-        setWidth(width);\r
-        setHeight(height);\r
-    }\r
-\r
-    /**\r
-     * Set the frequency, also known as refresh rate, for the \r
-     * rendering display.\r
-     * @param value The frequency\r
-     * (Default: 60)\r
-     */\r
-    public void setFrequency(int value) {\r
-        putInteger("Frequency", value);\r
-    }\r
-\r
-    /**\r
-     * Set the bits per pixel for the display. Appropriate\r
-     * values are 16 for RGB565 color format, or 24 for RGB8 color format.\r
-     * \r
-     * @param value The bits per pixel to set\r
-     * (Default: 24)\r
-     */\r
-    public void setBitsPerPixel(int value) {\r
-        putInteger("BitsPerPixel", value);\r
-    }\r
-\r
-    /**\r
-     * Set the number of samples per pixel. A value of 1 indicates\r
-     * each pixel should be single-sampled, higher values indicate\r
-     * a pixel should be multi-sampled.\r
-     * \r
-     * @param value The number of samples\r
-     * (Default: 1)\r
-     */\r
-    public void setSamples(int value) {\r
-        putInteger("Samples", value);\r
-    }\r
-\r
-    /**\r
-     * @param title The title of the rendering display\r
-     * (Default: jMonkeyEngine 3.0)\r
-     */\r
-    public void setTitle(String title) {\r
-        putString("Title", title);\r
-    }\r
-\r
-    /**\r
-     * @param value true to enable full-screen rendering, false to render in a window\r
-     * (Default: false)\r
-     */\r
-    public void setFullscreen(boolean value) {\r
-        putBoolean("Fullscreen", value);\r
-    }\r
-\r
-    /**\r
-     * Set to true to enable vertical-synchronization, limiting and synchronizing\r
-     * every frame rendered to the monitor's refresh rate.\r
-     * @param value \r
-     * (Default: false)\r
-     */\r
-    public void setVSync(boolean value) {\r
-        putBoolean("VSync", value);\r
-    }\r
-\r
-    /**\r
-     * Sets the application icons to be used, with the most preferred first.\r
-     * For Windows you should supply at least one 16x16 icon and one 32x32. The former is used for the title/task bar,\r
-     * the latter for the alt-tab icon.\r
-     * Linux (and similar platforms) expect one 32x32 icon.\r
-     * Mac OS X should be supplied one 128x128 icon.\r
-     * <br/>\r
-     * The icon is used for the settings window, and the LWJGL render window. Not currently supported for JOGL.\r
-     * Note that a bug in Java 6 (bug ID 6445278, currently hidden but available in Google cache) currently prevents\r
-     * the icon working for alt-tab on the settings dialog in Windows.\r
-     *\r
-     * @param value An array of BufferedImages to use as icons.\r
-     * (Default: not set)\r
-     */\r
-    public void setIcons(Object[] value) {\r
-        put("Icons", value);\r
-    }\r
-\r
-    public int getFrameRate() {\r
-        return getInteger("FrameRate");\r
-    }\r
-\r
-    public boolean useInput() {\r
-        return getBoolean("UseInput");\r
-    }\r
-\r
-    public String getRenderer() {\r
-        return getString("Renderer");\r
-    }\r
-\r
-    public int getWidth() {\r
-        return getInteger("Width");\r
-    }\r
-\r
-    public int getHeight() {\r
-        return getInteger("Height");\r
-    }\r
-\r
-    public int getBitsPerPixel() {\r
-        return getInteger("BitsPerPixel");\r
-    }\r
-\r
-    public int getFrequency() {\r
-        return getInteger("Frequency");\r
-    }\r
-\r
-    public int getDepthBits() {\r
-        return getInteger("DepthBits");\r
-    }\r
-\r
-    public int getStencilBits() {\r
-        return getInteger("StencilBits");\r
-    }\r
-\r
-    public int getSamples() {\r
-        return getInteger("Samples");\r
-    }\r
-\r
-    public String getTitle() {\r
-        return getString("Title");\r
-    }\r
-\r
-    public boolean isVSync() {\r
-        return getBoolean("VSync");\r
-    }\r
-\r
-    public boolean isFullscreen() {\r
-        return getBoolean("Fullscreen");\r
-    }\r
-\r
-    public boolean useJoysticks() {\r
-        return !getBoolean("DisableJoysticks");\r
-    }\r
-\r
-    public String getAudioRenderer() {\r
-        return getString("AudioRenderer");\r
-    }\r
-\r
-    public Object[] getIcons() {\r
-        return (Object[]) get("Icons");\r
-    }\r
-\r
-    public void setSettingsDialogImage(String path) {\r
-        settingsDialogImage = path;\r
-    }\r
-\r
-    public String getSettingsDialogImage() {\r
-        return settingsDialogImage;\r
-    }\r
-}\r
+/*
+ * Copyright (c) 2009-2010 jMonkeyEngine
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'jMonkeyEngine' nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package com.jme3.system;
+
+import com.jme3.renderer.Renderer;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.prefs.BackingStoreException;
+import java.util.prefs.Preferences;
+
+public class AppSettings extends HashMap<String, Object> {
+
+    private static final AppSettings defaults = new AppSettings(false);
+    public static final String LWJGL_OPENGL1 = "LWJGL-OPENGL1",
+                               LWJGL_OPENGL2 = "LWJGL-OpenGL2",
+                               LWJGL_OPENGL3 = "LWJGL-OpenGL3",
+                               LWJGL_OPENGL_ANY = "LWJGL-OpenGL-Any",
+                               JOGL = "JOGL",
+                               NULL = "NULL";
+    public static final String LWJGL_OPENAL = "LWJGL";
+    private String settingsDialogImage = "/com/jme3/app/Monkey.png";
+
+    static {
+        defaults.put("Width", 640);
+        defaults.put("Height", 480);
+        defaults.put("BitsPerPixel", 24);
+        defaults.put("Frequency", 60);
+        defaults.put("DepthBits", 24);
+        defaults.put("StencilBits", 0);
+        defaults.put("Samples", 0);
+        defaults.put("Fullscreen", false);
+        defaults.put("Title", "jMonkey Engine 3.0");
+        defaults.put("Renderer", LWJGL_OPENGL2);
+        defaults.put("AudioRenderer", LWJGL_OPENAL);
+        defaults.put("DisableJoysticks", true);
+        defaults.put("UseInput", true);
+        defaults.put("VSync", false);
+        defaults.put("FrameRate", -1);
+      //  defaults.put("Icons", null);
+
+        // disable these settings to benchmark speed
+//        defaults.put("VSync", true);
+//        defaults.put("FrameRate", 60);
+    }
+
+    /**
+     * Create Application settings
+     * use loadDefault=true, to load jME default values.
+     * use false if you want to change some settings but you would like the application to remind other settings from previous launches
+     * @param loadDefaults
+     */
+    public AppSettings(boolean loadDefaults) {
+        if (loadDefaults) {
+            putAll(defaults);
+        }
+    }
+
+    public void copyFrom(AppSettings other) {
+        this.putAll(other);
+    }
+
+    public void mergeFrom(AppSettings other) {
+        for (String key : other.keySet()) {
+            if (get(key) == null) {
+                put(key, other.get(key));
+            }
+        }
+    }
+
+    public void load(InputStream in) throws IOException {
+        Properties props = new Properties();
+        props.load(in);
+        for (Map.Entry<Object, Object> entry : props.entrySet()) {
+            String key = (String) entry.getKey();
+            String val = (String) entry.getValue();
+            if (val != null) {
+                val = val.trim();
+            }
+            if (key.endsWith("(int)")) {
+                key = key.substring(0, key.length() - 5);
+                int iVal = Integer.parseInt(val);
+                putInteger(key, iVal);
+            } else if (key.endsWith("(string)")) {
+                putString(key.substring(0, key.length() - 8), val);
+            } else if (key.endsWith("(bool)")) {
+                boolean bVal = Boolean.parseBoolean(val);
+                putBoolean(key.substring(0, key.length() - 6), bVal);
+            } else {
+                throw new IOException("Cannot parse key: " + key);
+            }
+        }
+    }
+
+    public void save(OutputStream out) throws IOException {
+        Properties props = new Properties();
+        for (Map.Entry<String, Object> entry : entrySet()) {
+            Object val = entry.getValue();
+            String type;
+            if (val instanceof Integer) {
+                type = "(int)";
+            } else if (val instanceof String) {
+                type = "(string)";
+            } else if (val instanceof Boolean) {
+                type = "(bool)";
+            } else {
+                throw new UnsupportedEncodingException();
+            }
+            props.setProperty(entry.getKey() + type, val.toString());
+        }
+        props.store(out, "jME3 AppSettings");
+    }
+
+    public void load(String preferencesKey) throws BackingStoreException {
+        Preferences prefs = Preferences.userRoot().node(preferencesKey);
+        String[] keys = prefs.keys();
+        if (keys != null) {
+            for (String key : keys) {
+                Object defaultValue = defaults.get(key);
+                if (defaultValue instanceof Integer) {
+                    put(key, prefs.getInt(key, (Integer) defaultValue));
+                } else if (defaultValue instanceof String) {
+                    put(key, prefs.get(key, (String) defaultValue));
+                } else if (defaultValue instanceof Boolean) {
+                    put(key, prefs.getBoolean(key, (Boolean) defaultValue));
+                }
+            }
+        }
+    }
+
+    public void save(String preferencesKey) throws BackingStoreException {
+        Preferences prefs = Preferences.userRoot().node(preferencesKey);
+        for (String key : keySet()) {         
+            prefs.put(key, get(key).toString());
+        }
+    }
+
+    public int getInteger(String key) {
+        Integer i = (Integer) get(key);
+        if (i == null) {
+            return 0;
+        }
+
+        return i.intValue();
+    }
+
+    public boolean getBoolean(String key) {
+        Boolean b = (Boolean) get(key);
+        if (b == null) {
+            return false;
+        }
+
+        return b.booleanValue();
+    }
+
+    public String getString(String key) {
+        String s = (String) get(key);
+        if (s == null) {
+            return null;
+        }
+
+        return s;
+    }
+
+    public void putInteger(String key, int value) {
+        put(key, Integer.valueOf(value));
+    }
+
+    public void putBoolean(String key, boolean value) {
+        put(key, Boolean.valueOf(value));
+    }
+
+    public void putString(String key, String value) {
+        put(key, value);
+    }
+
+    /**
+     * @param frameRate The frame-rate is the upper limit on how high
+     * the application's frames-per-second can go.
+     * (Default: -1 no frame rate limit imposed)
+     */
+    public void setFrameRate(int frameRate) {
+        putInteger("FrameRate", frameRate);
+    }
+
+    /**
+     * @param use If true, the application will initialize and use input.
+     * Set to false for headless applications that do not require keyboard
+     * or mouse input.
+     * (Default: true)
+     */
+    public void setUseInput(boolean use) {
+        putBoolean("UseInput", use);
+    }
+
+    /**
+     * @param use If true, the application will initialize and use joystick
+     * input. Set to false if no joystick input is desired.
+     * (Default: false)
+     */
+    public void setUseJoysticks(boolean use) {
+        putBoolean("DisableJoysticks", !use);
+    }
+
+    /**
+     * Set the graphics renderer to use, one of:<br>
+     * <ul>
+     * <li>AppSettings.LWJGL_OPENGL1 - Force OpenGL1.1 compatability</li>
+     * <li>AppSettings.LWJGL_OPENGL2 - Force OpenGL2 compatability</li>
+     * <li>AppSettings.LWJGL_OPENGL3 - Force OpenGL3.3 compatability</li>
+     * <li>AppSettings.LWJGL_OPENGL_ANY - Choose an appropriate 
+     * OpenGL version based on system capabilities</li>
+     * <li>null - Disable graphics rendering</li>
+     * </ul>
+     * @param renderer The renderer to set
+     * (Default: AppSettings.LWJGL_OPENGL2)
+     */
+    public void setRenderer(String renderer) {
+        putString("Renderer", renderer);
+    }
+
+    /**
+     * Set a custom graphics renderer to use. The class should implement 
+     * the {@link Renderer} interface.
+     * @param clazz The custom graphics renderer class.
+     * (Default: not set)
+     */
+    public void setCustomRenderer(Class clazz){
+        put("Renderer", "CUSTOM" + clazz.getName());
+    }
+
+    /**
+     * Set the audio renderer to use. One of:<br>
+     * <ul>
+     * <li>AppSettings.LWJGL_OPENAL - Default for LWJGL</li>
+     * <li>null - Disable audio</li>
+     * </ul>
+     * @param audioRenderer 
+     * (Default: LWJGL)
+     */
+    public void setAudioRenderer(String audioRenderer) {
+        putString("AudioRenderer", audioRenderer);
+    }
+
+    /**
+     * @param value the width for the rendering display.
+     * (Default: 640)
+     */
+    public void setWidth(int value) {
+        putInteger("Width", value);
+    }
+
+    /**
+     * @param value the height for the rendering display.
+     * (Default: 480)
+     */
+    public void setHeight(int value) {
+        putInteger("Height", value);
+    }
+
+    /**
+     * Set the resolution for the rendering display
+     * @param width The width
+     * @param height The height
+     * (Default: 640x480)
+     */
+    public void setResolution(int width, int height) {
+        setWidth(width);
+        setHeight(height);
+    }
+
+    /**
+     * Set the frequency, also known as refresh rate, for the 
+     * rendering display.
+     * @param value The frequency
+     * (Default: 60)
+     */
+    public void setFrequency(int value) {
+        putInteger("Frequency", value);
+    }
+
+    /**
+     * Set the bits per pixel for the display. Appropriate
+     * values are 16 for RGB565 color format, or 24 for RGB8 color format.
+     * 
+     * @param value The bits per pixel to set
+     * (Default: 24)
+     */
+    public void setBitsPerPixel(int value) {
+        putInteger("BitsPerPixel", value);
+    }
+
+    /**
+     * Set the number of samples per pixel. A value of 1 indicates
+     * each pixel should be single-sampled, higher values indicate
+     * a pixel should be multi-sampled.
+     * 
+     * @param value The number of samples
+     * (Default: 1)
+     */
+    public void setSamples(int value) {
+        putInteger("Samples", value);
+    }
+
+    /**
+     * @param title The title of the rendering display
+     * (Default: jMonkeyEngine 3.0)
+     */
+    public void setTitle(String title) {
+        putString("Title", title);
+    }
+
+    /**
+     * @param value true to enable full-screen rendering, false to render in a window
+     * (Default: false)
+     */
+    public void setFullscreen(boolean value) {
+        putBoolean("Fullscreen", value);
+    }
+
+    /**
+     * Set to true to enable vertical-synchronization, limiting and synchronizing
+     * every frame rendered to the monitor's refresh rate.
+     * @param value 
+     * (Default: false)
+     */
+    public void setVSync(boolean value) {
+        putBoolean("VSync", value);
+    }
+    
+    /**
+     * Enable 3D stereo.
+     * <p>This feature requires hardware support from the GPU driver. 
+     * See: http://en.wikipedia.org/wiki/Quad_buffering<br>
+     * Once enabled, filters or scene processors that handle 3D stereo rendering
+     * could use this feature to render using hardware 3D stereo.</p>
+     * (Default: false)
+     */
+    public void setStereo3D(boolean value){
+        putBoolean("Stereo3D", value);
+    }
+
+    /**
+     * Sets the application icons to be used, with the most preferred first.
+     * For Windows you should supply at least one 16x16 icon and one 32x32. The former is used for the title/task bar,
+     * the latter for the alt-tab icon.
+     * Linux (and similar platforms) expect one 32x32 icon.
+     * Mac OS X should be supplied one 128x128 icon.
+     * <br/>
+     * The icon is used for the settings window, and the LWJGL render window. Not currently supported for JOGL.
+     * Note that a bug in Java 6 (bug ID 6445278, currently hidden but available in Google cache) currently prevents
+     * the icon working for alt-tab on the settings dialog in Windows.
+     *
+     * @param value An array of BufferedImages to use as icons.
+     * (Default: not set)
+     */
+    public void setIcons(Object[] value) {
+        put("Icons", value);
+    }
+
+    public int getFrameRate() {
+        return getInteger("FrameRate");
+    }
+
+    public boolean useInput() {
+        return getBoolean("UseInput");
+    }
+
+    public String getRenderer() {
+        return getString("Renderer");
+    }
+
+    public int getWidth() {
+        return getInteger("Width");
+    }
+
+    public int getHeight() {
+        return getInteger("Height");
+    }
+
+    public int getBitsPerPixel() {
+        return getInteger("BitsPerPixel");
+    }
+
+    public int getFrequency() {
+        return getInteger("Frequency");
+    }
+
+    public int getDepthBits() {
+        return getInteger("DepthBits");
+    }
+
+    public int getStencilBits() {
+        return getInteger("StencilBits");
+    }
+
+    public int getSamples() {
+        return getInteger("Samples");
+    }
+
+    public String getTitle() {
+        return getString("Title");
+    }
+
+    public boolean isVSync() {
+        return getBoolean("VSync");
+    }
+
+    public boolean isFullscreen() {
+        return getBoolean("Fullscreen");
+    }
+
+    public boolean useJoysticks() {
+        return !getBoolean("DisableJoysticks");
+    }
+
+    public String getAudioRenderer() {
+        return getString("AudioRenderer");
+    }
+    
+    public boolean useStereo3D(){
+        return getBoolean("Stereo3D");  
+    }
+
+    public Object[] getIcons() {
+        return (Object[]) get("Icons");
+    }
+
+    public void setSettingsDialogImage(String path) {
+        settingsDialogImage = path;
+    }
+
+    public String getSettingsDialogImage() {
+        return settingsDialogImage;
+    }
+}