|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.bs.mdi.Preferences
Manages application-specific per-user preferences and settings.
| Field Summary | |
protected static String |
newline
|
| Constructor Summary | |
Preferences()
Creates a new Preferences object. |
|
| Method Summary | |
boolean |
getBoolean(String key,
boolean def)
Returns the boolean value specified by the given key from the preferences file. |
double |
getDouble(String key,
double def)
Returns the double value specified by the given key from the preferences file. |
int |
getInt(String key,
int def)
Returns the int value specified by the given key from the preferences file. |
long |
getLong(String key,
long def)
Returns the long value specified by the given key from the preferences file. |
Point |
getPoint(String key)
Returns the point specified by the given key from the preferences file. |
Rectangle |
getRectangle(String key)
Returns the rectangle specified by the given key from the preferences file. |
String |
getString(String key)
Returns the string specified by the given key from the preferences file. |
void |
load()
Loads the preferences from disk. |
protected String |
pointToString(Point p)
|
protected String |
rectangleToString(Rectangle rect)
|
void |
reload()
Reloads the preferences from disk |
void |
save()
Saves the preferences to disk. |
void |
setDouble(String key,
double value)
Writes the specified key-value pair into the preferences file. |
void |
setInt(String key,
int value)
Writes the specified key-value pair into the preferences file. |
void |
setLong(String key,
long value)
Writes the specified key-value pair into the preferences file. |
void |
setPoint(String key,
Point value)
Writes the specified key-value pair into the preferences file. |
void |
setRectangle(String key,
Rectangle value)
Writes the specified key-value pair into the preferences file. |
void |
setString(String key,
String value)
Writes the specified key-value pair into the preferences file. |
protected Boolean |
stringToBoolean(String s)
|
protected Point |
stringToPoint(String s)
|
protected Rectangle |
stringToRectangle(String s)
|
protected Object |
toObject(String s)
|
protected String |
toString(Object o)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static String newline
| Constructor Detail |
public Preferences()
Application.getName()) as filename to store and retrieve
user settings. The preferences file is usually created in the user's home
directory and prefixed with a dot character to make it invisible on
UNIX machines.
| Method Detail |
public void save()
public void load()
public void reload()
public String getString(String key)
key - the key
public int getInt(String key,
int def)
key - the keydef - the default value which will be returned in case of error
public long getLong(String key,
long def)
key - the keydef - the default value which will be returned in case of error
public double getDouble(String key,
double def)
key - the keydef - the default value which will be returned in case of error
public Point getPoint(String key)
key - the key
public Rectangle getRectangle(String key)
key - the key
public boolean getBoolean(String key,
boolean def)
key - the keydef - the default value which will be returned in case of error
public void setString(String key,
String value)
key - the keyvalue - the value
public void setInt(String key,
int value)
key - the keyvalue - the value
public void setLong(String key,
long value)
key - the keyvalue - the value
public void setDouble(String key,
double value)
key - the keyvalue - the value
public void setPoint(String key,
Point value)
key - the keyvalue - the value
public void setRectangle(String key,
Rectangle value)
key - the keyvalue - the valueprotected String pointToString(Point p)
protected String rectangleToString(Rectangle rect)
protected Point stringToPoint(String s)
protected Rectangle stringToRectangle(String s)
protected Boolean stringToBoolean(String s)
protected String toString(Object o)
protected Object toObject(String s)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||