|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.system.PropertiesIO
public class PropertiesIO
PropertiesIO
handles loading and saving a properties file that
defines the display settings. A property file is identified during creation
of the object. The properties file should have the following format:
FREQ=60
RENDERER=LWJGL
WIDTH=1280
HEIGHT=1024
DEPTH=32
FULLSCREEN=false
Field Summary | |
---|---|
static int |
DEFAULT_DEPTH
The default depth, used if there is a problem with the properties file. |
static int |
DEFAULT_FREQ
The default frequency, used if there is a problem with the properties file. |
static boolean |
DEFAULT_FULLSCREEN
The default fullscreen flag, used if there is a problem with the properties file. |
static int |
DEFAULT_HEIGHT
The default height, used if there is a problem with the properties file. |
static java.lang.String |
DEFAULT_RENDERER
The default renderer flag, used if there is a problem with the properties file. |
static int |
DEFAULT_WIDTH
The default width, used if there is a problem with the properties file. |
Constructor Summary | |
---|---|
PropertiesIO(java.lang.String filename)
Constructor creates the PropertiesIO object for use. |
Method Summary | |
---|---|
java.lang.String |
get(java.lang.String key)
get takes an arbitrary string as a key and returns any
value associated with it, null if none. |
int |
getDepth()
getDepth returns the depth as read from the properties
file. |
int |
getFreq()
getFreq returns the frequency of the monitor as read from
the properties file. |
boolean |
getFullscreen()
getFullscreen returns the fullscreen flag as read from the
properties file. |
int |
getHeight()
getHeight returns the height as read from the properties
file. |
java.lang.String |
getRenderer()
getRenderer returns the requested rendering API, or the
default. |
int |
getWidth()
getWidth returns the width as read from the properties
file. |
boolean |
load()
load attempts to load the properties file defined during
instantiation and put all properties in the table. |
boolean |
save(int width,
int height,
int depth,
int freq,
boolean fullscreen,
java.lang.String renderer)
save overwrites the properties file with the given
parameters. |
void |
set(java.lang.String key,
java.lang.String value)
set adds a key/value pair to the properties list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
public static final int DEFAULT_DEPTH
public static final int DEFAULT_FREQ
public static final boolean DEFAULT_FULLSCREEN
public static final java.lang.String DEFAULT_RENDERER
Constructor Detail |
---|
public PropertiesIO(java.lang.String filename)
PropertiesIO
object for use.
filename
- the properties file to use.
JmeException
- if the filename is null.Method Detail |
---|
public boolean load()
load
attempts to load the properties file defined during
instantiation and put all properties in the table. If there is a problem
loading or reading the file, false is returned. If all goes well, true is
returned.
public boolean save(int width, int height, int depth, int freq, boolean fullscreen, java.lang.String renderer)
save
overwrites the properties file with the given
parameters.
width
- the width of the resolution.height
- the height of the resolution.depth
- the bits per pixel.freq
- the frequency of the monitor.fullscreen
- use fullscreen or not.
public int getWidth()
getWidth
returns the width as read from the properties
file. If the properties file does not contain width or was not read
properly, the default width is returned.
public int getHeight()
getHeight
returns the height as read from the properties
file. If the properties file does not contain height or was not read
properly, the default height is returned.
public int getDepth()
getDepth
returns the depth as read from the properties
file. If the properties file does not contain depth or was not read
properly, the default depth is returned.
public int getFreq()
getFreq
returns the frequency of the monitor as read from
the properties file. If the properties file does not contain frequency
or was not read properly the default frequency is returned.
public boolean getFullscreen()
getFullscreen
returns the fullscreen flag as read from the
properties file. If the properties file does not contain the fullscreen
flag or was not read properly, the default fullscreen flag is returned.
public java.lang.String getRenderer()
getRenderer
returns the requested rendering API, or the
default.
public java.lang.String get(java.lang.String key)
get
takes an arbitrary string as a key and returns any
value associated with it, null if none.
key
- the key to use for data retrieval.
public void set(java.lang.String key, java.lang.String value)
set
adds a key/value pair to the properties list.
key
- the key of the pair.value
- the value of the pair.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |