de.uni_paderborn.fujaba.preferences
Class PreferencesProperties

java.lang.Object
  extended byde.uni_paderborn.fujaba.preferences.PreferencesProperties

public class PreferencesProperties
extends java.lang.Object

Singleton Class 'PreferencesProperties' handles the preferences for the Fujaba application.

Version:
$Revision: 1.10.2.4 $
Author:
$Author: lowende $

Field Summary
static java.lang.String PROPERTY_DIR_PROPERTY
          Key for the 'propertyDir' attribute that will be used by FujabaApp to store the propertyDir in a (property) file.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Access method for an one to n association.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Access method for an one to n association.
 void firePropertyChange(java.beans.PropertyChangeEvent event)
          No comment provided by developer, please add a comment to improve documentation.
 void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
          No comment provided by developer, please add a comment to improve documentation.
 void firePropertyChange(java.lang.String propertyName, int oldValue, int newValue)
          No comment provided by developer, please add a comment to improve documentation.
 void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          No comment provided by developer, please add a comment to improve documentation.
static PreferencesProperties get()
          Wrapper for the old singleton get() method.
static PreferencesProperties get(java.lang.String fileName)
           
 boolean getBoolSetting(java.lang.String key)
          Get the boolSetting attribute of the PropertyOptions object
 boolean getBoolSetting(java.lang.String key, boolean defaultValue)
          Get the boolSetting attribute of the PropertyOptions object
 java.awt.Color getColorSetting(java.lang.String key, java.awt.Color defaultValue)
          Get the colorSetting attribute of the PropertyOptions object
 double getDoubleSetting(java.lang.String key)
          Get the doubleSetting attribute of the PropertyOptions object
 double getDoubleSetting(java.lang.String key, double defaultValue)
          Get the doubleSetting attribute of the PropertyOptions object
 float getFloatSetting(java.lang.String key)
          Get the floatSetting attribute of the PropertyOptions object
 float getFloatSetting(java.lang.String key, float defaultValue)
          Get the floatSetting attribute of the PropertyOptions object
 java.util.Hashtable getHashtableSetting(java.lang.String key, java.lang.String name)
          Get the hashtableSetting attribute of the PropertyOptions object
 int getIntSetting(java.lang.String key)
          Get the intSetting attribute of the PropertyOptions object
 int getIntSetting(java.lang.String key, int defaultValue)
          Get the intSetting attribute of the PropertyOptions object
 java.beans.PropertyChangeListener[] getPropertyChangeListeners()
          Get the propertyChangeListeners attribute of the PreferencesProperties object
 java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String arg0)
          Get the propertyChangeListeners attribute of the PreferencesProperties object
static java.lang.String getPropertyDir()
          Get the directory in which Fujaba properties are stored.
static java.lang.String getProposedPropertyDir()
          Get the default directory in which Fujaba properties should be stored.
 java.lang.String getSetting(java.lang.String key)
          get a specified setting from the Properties
 java.lang.String getSetting(java.lang.String key, java.lang.String defaultValue)
          get a specified setting from the Properties
 java.util.Vector getVectorSetting(java.lang.String key)
          Get a preferences vector.
 java.util.Vector getVectorSetting(java.lang.String key, java.util.Vector defVector)
          Get a preferences vector.
 boolean hasListeners(java.lang.String arg0)
          No comment provided by developer, please add a comment to improve documentation.
 void putSetting(java.lang.String key, boolean value)
          No comment provided by developer, please add a comment to improve documentation.
 void putSetting(java.lang.String key, java.awt.Color col)
          No comment provided by developer, please add a comment to improve documentation.
 void putSetting(java.lang.String key, double value)
          No comment provided by developer, please add a comment to improve documentation.
 void putSetting(java.lang.String key, float value)
          No comment provided by developer, please add a comment to improve documentation.
 void putSetting(java.lang.String key, int value)
          No comment provided by developer, please add a comment to improve documentation.
 void putSetting(java.lang.String key, java.util.List settings)
          No comment provided by developer, please add a comment to improve documentation.
 void putSetting(java.lang.String key, java.lang.String value)
          No comment provided by developer, please add a comment to improve documentation.
 void putSetting(java.lang.String key, java.lang.String name, java.util.Hashtable settings)
          No comment provided by developer, please add a comment to improve documentation.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          No comment provided by developer, please add a comment to improve documentation.
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          No comment provided by developer, please add a comment to improve documentation.
 void save()
          Saves the options in separate file.
static void saveAll()
          Saves all PropertiesOptions including core and plugin options.
static void setPropertyDir(java.lang.String value)
          Set the directory in which Fujaba properties are stored.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_DIR_PROPERTY

public static final java.lang.String PROPERTY_DIR_PROPERTY
Key for the 'propertyDir' attribute that will be used by FujabaApp to store the propertyDir in a (property) file.
 Note: The key contains the fujaba base-directory
   (installation-directory) as keyword, so
   every fujaba installation
   may define its own propertyDir.
 

Method Detail

get

public static PreferencesProperties get()
Wrapper for the old singleton get() method.

Returns:
The Fujaba core properties.

get

public static PreferencesProperties get(java.lang.String fileName)
Returns:
The PropertyOptions for a plugin, for example.

saveAll

public static void saveAll()
Saves all PropertiesOptions including core and plugin options.


save

public void save()
Saves the options in separate file.


getPropertyDir

public static java.lang.String getPropertyDir()
Get the directory in which Fujaba properties are stored.
 Note: the propertyDir ends with a file separator.
 Note: if the propertyDir has not been set, a call to
       this function will initialize the propertyDir with
       the proposedPropertyDir.
 

Returns:
The directory in which properties are stored.
See Also:
getProposedPropertyDir()

setPropertyDir

public static void setPropertyDir(java.lang.String value)
Set the directory in which Fujaba properties are stored.

 Note: do not change propertyDir during runtime, for now!
 Properties won't be adjusted, if the propertyDir changes.
 Use startup-parameter in class 'FujabaApp' to change the
 propertyDir during startup.
 

Parameters:
value -
See Also:
FujabaApp.main(String[])

getProposedPropertyDir

public static java.lang.String getProposedPropertyDir()
Get the default directory in which Fujaba properties should be stored. The directory-name is constructed dependent on the version number of the fujaba application and is basically located in the users home directory. Note: the propertyDir ends with a file separator.

Returns:
The directory in which properties should be stored.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Access method for an one to n association.

Parameters:
listener - The object added.

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)
Access method for an one to n association.

Parameters:
propertyName - The object added.
listener - The object added.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
listener - No description provided

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
propertyName - No description provided
listener - No description provided

firePropertyChange

public void firePropertyChange(java.beans.PropertyChangeEvent event)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
event - No description provided

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               boolean oldValue,
                               boolean newValue)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
propertyName - No description provided
oldValue - No description provided
newValue - No description provided

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               int oldValue,
                               int newValue)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
propertyName - No description provided
oldValue - No description provided
newValue - No description provided

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
propertyName - No description provided
oldValue - No description provided
newValue - No description provided

getPropertyChangeListeners

public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
Get the propertyChangeListeners attribute of the PreferencesProperties object

Returns:
The propertyChangeListeners value

getPropertyChangeListeners

public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String arg0)
Get the propertyChangeListeners attribute of the PreferencesProperties object

Parameters:
arg0 - No description provided
Returns:
The propertyChangeListeners value

hasListeners

public boolean hasListeners(java.lang.String arg0)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
arg0 - No description provided
Returns:
No description provided

getSetting

public java.lang.String getSetting(java.lang.String key)
get a specified setting from the Properties

Parameters:
key - The settings key
Returns:
The value of the setting specified by key

getSetting

public java.lang.String getSetting(java.lang.String key,
                                   java.lang.String defaultValue)
get a specified setting from the Properties

Parameters:
key - The settings key
defaultValue - No description provided
Returns:
The value of the setting specified by key

getBoolSetting

public boolean getBoolSetting(java.lang.String key)
Get the boolSetting attribute of the PropertyOptions object

Parameters:
key - No description provided
Returns:
The boolSetting value

getBoolSetting

public boolean getBoolSetting(java.lang.String key,
                              boolean defaultValue)
Get the boolSetting attribute of the PropertyOptions object

Parameters:
key - No description provided
defaultValue - No description provided
Returns:
The boolSetting value

getIntSetting

public int getIntSetting(java.lang.String key)
                  throws java.lang.NumberFormatException
Get the intSetting attribute of the PropertyOptions object

Parameters:
key - No description provided
Returns:
The intSetting value
Throws:
java.lang.NumberFormatException - Exception description not provided

getIntSetting

public int getIntSetting(java.lang.String key,
                         int defaultValue)
                  throws java.lang.NumberFormatException
Get the intSetting attribute of the PropertyOptions object

Parameters:
key - No description provided
defaultValue - No description provided
Returns:
The intSetting value
Throws:
java.lang.NumberFormatException - Exception description not provided

getFloatSetting

public float getFloatSetting(java.lang.String key)
                      throws java.lang.NumberFormatException
Get the floatSetting attribute of the PropertyOptions object

Parameters:
key - No description provided
Returns:
The floatSetting value
Throws:
java.lang.NumberFormatException - Exception description not provided

getFloatSetting

public float getFloatSetting(java.lang.String key,
                             float defaultValue)
                      throws java.lang.NumberFormatException
Get the floatSetting attribute of the PropertyOptions object

Parameters:
key - No description provided
defaultValue - No description provided
Returns:
The floatSetting value
Throws:
java.lang.NumberFormatException - Exception description not provided

getDoubleSetting

public double getDoubleSetting(java.lang.String key)
                        throws java.lang.NumberFormatException
Get the doubleSetting attribute of the PropertyOptions object

Parameters:
key - No description provided
Returns:
The doubleSetting value
Throws:
java.lang.NumberFormatException - Exception description not provided

getDoubleSetting

public double getDoubleSetting(java.lang.String key,
                               double defaultValue)
                        throws java.lang.NumberFormatException
Get the doubleSetting attribute of the PropertyOptions object

Parameters:
key - No description provided
defaultValue - No description provided
Returns:
The doubleSetting value
Throws:
java.lang.NumberFormatException - Exception description not provided

getVectorSetting

public java.util.Vector getVectorSetting(java.lang.String key)
Get a preferences vector.

Parameters:
key - The property key
Returns:
The preferences vector, if the key can be found, otherwise an empty vector.

getVectorSetting

public java.util.Vector getVectorSetting(java.lang.String key,
                                         java.util.Vector defVector)
Get a preferences vector.

Parameters:
key - The property key
defVector - The default vector
Returns:
The preferences vector, if the key can be found, otherwise the default vector.

getHashtableSetting

public java.util.Hashtable getHashtableSetting(java.lang.String key,
                                               java.lang.String name)
Get the hashtableSetting attribute of the PropertyOptions object

Parameters:
key - No description provided
name - No description provided
Returns:
The hashtableSetting value

getColorSetting

public java.awt.Color getColorSetting(java.lang.String key,
                                      java.awt.Color defaultValue)
Get the colorSetting attribute of the PropertyOptions object

Parameters:
key - No description provided
defaultValue - No description provided
Returns:
The colorSetting value

putSetting

public void putSetting(java.lang.String key,
                       java.lang.String value)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
key - No description provided
value - No description provided

putSetting

public void putSetting(java.lang.String key,
                       boolean value)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
key - No description provided
value - No description provided

putSetting

public void putSetting(java.lang.String key,
                       int value)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
key - No description provided
value - No description provided

putSetting

public void putSetting(java.lang.String key,
                       float value)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
key - No description provided
value - No description provided

putSetting

public void putSetting(java.lang.String key,
                       double value)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
key - No description provided
value - No description provided

putSetting

public void putSetting(java.lang.String key,
                       java.util.List settings)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
key - No description provided
settings - No description provided

putSetting

public void putSetting(java.lang.String key,
                       java.lang.String name,
                       java.util.Hashtable settings)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
key - No description provided
name - No description provided
settings - No description provided

putSetting

public void putSetting(java.lang.String key,
                       java.awt.Color col)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
key - No description provided
col - No description provided