|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary
java.util.Hashtable
java.util.Properties
jas.util.UserProperties
public class UserProperties
This class is used to store user prorerties. There is one instance for the application. The
UserProperties object used is available from the Application object using a getUserProperties()
method.
Application
,
Application.getUserProperties()
,
Serialized FormField Summary |
---|
Fields inherited from class java.util.Properties |
---|
defaults |
Constructor Summary | |
---|---|
|
UserProperties()
The Application object will create an instance for the application and save it just before the application closes. |
protected |
UserProperties(Properties def)
|
Method Summary | |
---|---|
boolean |
getBoolean(String key,
boolean def)
|
Color |
getColor(String key,
Color def)
|
float |
getFloat(String key,
float def)
|
int |
getInteger(String key)
|
int |
getInteger(String key,
int def)
|
Rectangle |
getRectangle(String key,
Rectangle def)
|
String |
getString(String key,
String def)
|
String[] |
getStringArray(String key,
String[] def)
|
static UserProperties |
getUserProperties()
|
void |
save()
Saves the properties. |
void |
setBoolean(String key,
boolean value)
|
void |
setColor(String key,
Color c)
|
void |
setFloat(String key,
float f)
|
void |
setInteger(String key,
int i)
|
void |
setRectangle(String key,
Rectangle rect)
|
void |
setString(String key,
String s)
|
void |
setStringArray(String key,
String[] sa)
|
static String[] |
updateStringArray(String[] oldArray,
String newString)
This is a utility method for updating a string array of recently used items. |
static String[] |
updateStringArray(String[] oldArray,
String newString,
int nStored)
This is a utility method for updating a string array of recently used items. |
String[] |
updateStringArray(String[] oldArray,
String newString,
String lengthKey)
This is a utility method for updating a string array of recently used items. |
Methods inherited from class java.util.Properties |
---|
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames |
Methods inherited from class java.util.Hashtable |
---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UserProperties()
getUserProperties()
method.
Application
,
Application.getUserProperties()
protected UserProperties(Properties def)
Method Detail |
---|
public Rectangle getRectangle(String key, Rectangle def)
key
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic void setRectangle(String key, Rectangle rect)
key
- the key used to store this propertyrect
- the value to storepublic Color getColor(String key, Color def)
key
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic void setColor(String key, Color c)
key
- the key used to store this propertyc
- the value to storepublic String[] getStringArray(String key, String[] def)
key
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic void setStringArray(String key, String[] sa)
key
- the key used to store this propertysa
- the value to storepublic String getString(String key, String def)
key
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic void setString(String key, String s)
key
- the key used to store this propertys
- the value to storepublic boolean getBoolean(String key, boolean def)
key
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic void setBoolean(String key, boolean value)
key
- the key used to store this propertyvalue
- the value to storepublic int getInteger(String key) throws NumberFormatException
key
- the key used to store this property
NumberFormatException
- if the property retrieved cannot be converted to int
public int getInteger(String key, int def)
key
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic void setFloat(String key, float f)
key
- the key used to store this propertyf
- the value to storepublic float getFloat(String key, float def)
key
- the key used to store this propertydef
- a default in case the property cannot be retrievedpublic void setInteger(String key, int i)
key
- the key used to store this propertyi
- the value to storepublic void save() throws IOException
IOException
public static String[] updateStringArray(String[] oldArray, String newString)
oldArray
- the array to update (may safely be null
)newString
- the new item to include
public String[] updateStringArray(String[] oldArray, String newString, String lengthKey)
oldArray
- the array to update (may safely be null
)newString
- the new item to includelengthKey
- the key used to find the maximum length of the resulting array
public static String[] updateStringArray(String[] oldArray, String newString, int nStored)
nStored
parameter.
oldArray
- the array to update (may safely be null
)newString
- the new item to includenStored
- the maximum size of the updated array
public static UserProperties getUserProperties()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |