public class PropManager
extends java.lang.Object
implements java.io.Serializable
We manage three levels of defaults: user defaults, system defaults and basic defaults. A call to PropManager.get() checks all three levels in order and returns the first non-null value for a key, if any.
A call to PropManager.put() just affects the user defaults.
If the initialize routine will be used with the arguments of the
main
routine, it is possible to overload each property value.
The syntax for that behaviour is
-key valuefor a key value pair or
-keyfor a boolean value.
The initialization looks first for command line argument and collect the
given key value pairs.
Then it reads the property file
.
This value can be overwritten by the command line keyword -highqsoft.properties
.
Then it looks for the keywords basic.properties, system.properties
and user.properties
in order.
These values can be set inside the highqsoft.properties
file
or even by command line arguments that overwrite the highqsoft.properties
.
The file basic.properties
will overload the values inside the
BasicProperties class that builds the basic property table.
The others will build the system and the user property table.
Warning: The basic property table is the last instance to found a meaningful value. This can lead to an exception because all classes that use the PropManager expect a useful value. e.g: If the user makes an incorrect font specification for the basic property table, the PropManager returns null for that property.
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
BasicProperties
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
COLUMN_ACCESS_INTERFACE
Mimetype column access interface.
|
static java.lang.String |
VALUE_MATRIX_INTERFACE
Mimetype value matrix access interface.
|
Constructor and Description |
---|
PropManager() |
Modifier and Type | Method and Description |
---|---|
static void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.
|
static java.lang.Object |
get(java.lang.Object key)
Get a Object value property.
|
static boolean |
getBoolean(java.lang.Object key)
Get a boolean value property.
|
static java.awt.datatransfer.DataFlavor |
getBusFlavor(java.lang.String className)
Get ASAM data flavor.
|
static java.awt.datatransfer.DataFlavor |
getBusFlavor(java.lang.String className,
java.lang.String flavorSubtype)
Get ASAM data flavor.
|
static java.awt.Color |
getColor(java.lang.Object key)
Get a Color value property.
|
static PropDefaults |
getDefaults()
Returns the MultiPropDefaults table.
|
static double |
getDouble(java.lang.Object key)
Get a double value property.
|
static float |
getFloat(java.lang.Object key)
Get a float value property.
|
static java.awt.Font |
getFont(java.lang.Object key)
Get a Font value property.
|
static int |
getInt(java.lang.Object key)
Get a int value property.
|
static long |
getLong(java.lang.Object key)
Get a long value property.
|
static java.lang.String |
getString(java.lang.Object key)
Get a String value property.
|
static void |
initialize(java.lang.String[] args)
Initialize the property tables.
|
static java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Sets a new property for the key.
|
static void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.
|
public static final java.lang.String COLUMN_ACCESS_INTERFACE
public static final java.lang.String VALUE_MATRIX_INTERFACE
public static PropDefaults getDefaults()
public static java.awt.Font getFont(java.lang.Object key)
public static java.awt.Color getColor(java.lang.Object key)
public static java.lang.String getString(java.lang.Object key)
public static int getInt(java.lang.Object key)
public static boolean getBoolean(java.lang.Object key)
public static long getLong(java.lang.Object key)
public static float getFloat(java.lang.Object key)
public static double getDouble(java.lang.Object key)
public static java.awt.datatransfer.DataFlavor getBusFlavor(java.lang.String className)
public static java.awt.datatransfer.DataFlavor getBusFlavor(java.lang.String className, java.lang.String flavorSubtype)
className
- the name of the class of the flavor.subtype
- the subtype of the flavor without the leading 'x-'public static java.lang.Object get(java.lang.Object key)
public static java.lang.Object put(java.lang.Object key, java.lang.Object value)
public static void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be addedPropertyChangeSupport
public static void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removedPropertyChangeSupport
public static void initialize(java.lang.String[] args)