|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.system.AbstractGameSettings
com.jme.system.PreferencesGameSettings
public class PreferencesGameSettings
PreferencesGameSettings
uses the Preferences system in Java
and implements the GameSettings
interface.
GameSettings
Field Summary |
---|
Fields inherited from class com.jme.system.AbstractGameSettings |
---|
defaultAlphaBits, defaultDepth, defaultDepthBits, defaultFramerate, defaultFrequency, defaultFullscreen, defaultHeight, defaultMusic, defaultRenderer, defaultSamples, defaultSettingsWidgetImage, defaultSFX, defaultStencilBits, defaultVerticalSync, defaultWidth, isNew |
Fields inherited from interface com.jme.system.GameSettings |
---|
DEFAULT_ALPHA_BITS, DEFAULT_DEPTH, DEFAULT_DEPTH_BITS, DEFAULT_FRAMERATE, DEFAULT_FREQUENCY, DEFAULT_FULLSCREEN, DEFAULT_HEIGHT, DEFAULT_MUSIC, DEFAULT_RENDERER, DEFAULT_SAMPLES, DEFAULT_SFX, DEFAULT_STENCIL_BITS, DEFAULT_VERTICAL_SYNC, DEFAULT_WIDTH |
Constructor Summary | |
---|---|
PreferencesGameSettings(java.util.prefs.Preferences preferences)
Warning: Only the caller knows whether the passed 'preferences' object is new. |
|
PreferencesGameSettings(java.util.prefs.Preferences preferences,
boolean isNew)
Legacy constructor wrapper. |
|
PreferencesGameSettings(java.util.prefs.Preferences preferences,
boolean isNew,
java.lang.String dfltsFilename)
Use this constructor to set the defaults for your game according to a file like "gamename.properties" in the root of a CLASSPATH element (like in the root of a jar file). |
Method Summary | |
---|---|
void |
clear()
Clears all settings. |
java.lang.String |
get(java.lang.String name,
java.lang.String defaultValue)
|
int |
getAlphaBits()
Returns the alpha bits to use for the renderer as stored or the default. |
boolean |
getBoolean(java.lang.String name,
boolean defaultValue)
|
byte[] |
getByteArray(java.lang.String name,
byte[] defaultValue)
|
int |
getDepth()
Returns the depth for the screen as stored or the default. |
int |
getDepthBits()
Returns the depth bits to use for the renderer as stored or the default. |
double |
getDouble(java.lang.String name,
double defaultValue)
|
float |
getFloat(java.lang.String name,
float defaultValue)
|
int |
getFramerate()
Returns the specified framerate or -1 if variable framerate is specified. |
int |
getFrequency()
Returns the screen refresh frequency as stored or the default. |
int |
getHeight()
Returns the height for the screen as stored or the default. |
int |
getInt(java.lang.String name,
int defaultValue)
|
long |
getLong(java.lang.String name,
long defaultValue)
|
java.lang.Object |
getObject(java.lang.String name,
java.lang.Object defaultValue)
|
java.lang.String |
getRenderer()
Returns the stored rendering API name, or the default |
int |
getSamples()
Returns the number of samples to use for the multisample buffer as stored or the default. |
int |
getStencilBits()
Returns the stencil bits to use for the renderer as stored or the default. |
int |
getWidth()
Returns the width for the screen as stored or the default. |
boolean |
isFullscreen()
Returns the screen's fullscreen status as stored or the default. |
boolean |
isMusic()
Returns the enabled status of music as stored or the default. |
boolean |
isSFX()
Returns the enabled status of sound effects as stored or the default. |
boolean |
isVerticalSync()
Returns the current state of vertical synchronization. |
void |
remove(java.lang.String name)
|
void |
save()
This method forces the Preferences node to (re)persist now. |
void |
set(java.lang.String name,
java.lang.String value)
|
void |
setAlphaBits(int alphaBits)
Sets the alpha bits for use with the renderer. |
void |
setBoolean(java.lang.String name,
boolean value)
|
void |
setByteArray(java.lang.String name,
byte[] value)
|
void |
setDepth(int depth)
Sets the depth for the screen. |
void |
setDepthBits(int depthBits)
Sets the depth bits for use with the renderer. |
void |
setDouble(java.lang.String name,
double value)
|
void |
setFloat(java.lang.String name,
float value)
|
void |
setFramerate(int framerate)
Sets the framerate. |
void |
setFrequency(int frequency)
Sets the screen refresh frequency. |
void |
setFullscreen(boolean fullscreen)
Sets the fullscreen status for the screen. |
void |
setHeight(int height)
Sets the height for the screen. |
void |
setInt(java.lang.String name,
int value)
|
void |
setLong(java.lang.String name,
long value)
|
void |
setMusic(boolean musicEnabled)
Sets the enabled status of music. |
void |
setObject(java.lang.String name,
java.lang.Object value)
|
void |
setRenderer(java.lang.String renderer)
Sets the rendering API. |
void |
setSamples(int samples)
Sets the number of samples to use for the multisample buffer. |
void |
setSFX(boolean sfxEnabled)
Sets the enabled status of sound effects. |
void |
setStencilBits(int stencilBits)
Sets the stencil bits for use with the renderer. |
void |
setVerticalSync(boolean vsync)
Sets the state of vertical synchronization. |
void |
setWidth(int width)
Sets the width for the screen. |
Methods inherited from class com.jme.system.AbstractGameSettings |
---|
assignDefaults, getDefaultSettingsWidgetImage, isNew, loadBoolean, loadInteger, normalizeName, setIsNew |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PreferencesGameSettings(java.util.prefs.Preferences preferences)
AbstractGameSettings.setIsNew(boolean)
,
PreferencesGameSettings(Preferences, boolean, String)
public PreferencesGameSettings(java.util.prefs.Preferences preferences, boolean isNew)
PreferencesGameSettings(Preferences, boolean, String)
public PreferencesGameSettings(java.util.prefs.Preferences preferences, boolean isNew, java.lang.String dfltsFilename)
dfltsFilename
- the properties file to use, read from CLASSPATH.
Null to not seek any runtime defaults file.Method Detail |
---|
public java.lang.String getRenderer()
GameSettings
public void setRenderer(java.lang.String renderer)
GameSettings
public int getWidth()
GameSettings
public void setWidth(int width)
GameSettings
public int getHeight()
GameSettings
public void setHeight(int height)
GameSettings
public int getDepth()
GameSettings
public void setDepth(int depth)
GameSettings
public int getFrequency()
GameSettings
public void setFrequency(int frequency)
GameSettings
public boolean isVerticalSync()
GameSettings
public void setVerticalSync(boolean vsync)
GameSettings
public boolean isFullscreen()
GameSettings
public void setFullscreen(boolean fullscreen)
GameSettings
public int getDepthBits()
GameSettings
public void setDepthBits(int depthBits)
GameSettings
public int getAlphaBits()
GameSettings
public void setAlphaBits(int alphaBits)
GameSettings
public int getStencilBits()
GameSettings
public void setStencilBits(int stencilBits)
GameSettings
public int getSamples()
GameSettings
public void setSamples(int samples)
GameSettings
public boolean isMusic()
GameSettings
public void setMusic(boolean musicEnabled)
GameSettings
public boolean isSFX()
GameSettings
public void setSFX(boolean sfxEnabled)
GameSettings
public int getFramerate()
GameSettings
public void setFramerate(int framerate)
GameSettings
public void clear() throws java.io.IOException
GameSettings
java.io.IOException
- If there is some consistency or access problem
obtaining the values to be cleared.GameSettings.clear()
public java.lang.String get(java.lang.String name, java.lang.String defaultValue)
public boolean getBoolean(java.lang.String name, boolean defaultValue)
public double getDouble(java.lang.String name, double defaultValue)
public float getFloat(java.lang.String name, float defaultValue)
public int getInt(java.lang.String name, int defaultValue)
public long getLong(java.lang.String name, long defaultValue)
public byte[] getByteArray(java.lang.String name, byte[] defaultValue)
public java.lang.Object getObject(java.lang.String name, java.lang.Object defaultValue)
public void set(java.lang.String name, java.lang.String value)
public void setBoolean(java.lang.String name, boolean value)
public void setDouble(java.lang.String name, double value)
public void setFloat(java.lang.String name, float value)
public void setInt(java.lang.String name, int value)
public void setLong(java.lang.String name, long value)
public void setByteArray(java.lang.String name, byte[] value)
public void setObject(java.lang.String name, java.lang.Object value)
public void remove(java.lang.String name)
public void save() throws java.io.IOException
java.io.IOException
Preferences
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |