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 $
Author:
$Author: schneider $

Field Summary
private static java.lang.String baseDir
          The directory where the options are stored.
private static java.lang.String CORE_PROPERTIES
          Fujaba core properties file name
private  java.util.Properties properties
          The properties hash table.
private static java.lang.String PROPERTY_DIR
          Directory for all properties.
private  java.beans.PropertyChangeSupport propertyChangeSupport
          No comment provided by developer, please add a comment to improve documentation.
private static java.util.HashMap propertyOptions
          The table where all propertiesOptions are stored.
private  java.io.File settingsFile
          The file for the properties.
 
Constructor Summary
private PreferencesProperties(java.lang.String fileName)
          Private constructor, use get () or get(key) to get an instance.
 
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.
private  void generateDefaultSettings()
          Generate Default settings for Fujaba, needs to be modified for new settings.
static PreferencesProperties get()
          Wrapper for the old singleton get() method.
static PreferencesProperties get(java.lang.String fileName)
           
static java.lang.String getBaseDir()
          Getter for attribute baseDir.
 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 baseDir attribute of the PropertyOptions class
 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.
private  void load(java.lang.String fileName)
          Loads the options.
 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 setBaseDir(java.lang.String dir)
          Setter for attribute baseDir.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

settingsFile

private java.io.File settingsFile
The file for the properties.


properties

private java.util.Properties properties
The properties hash table.


propertyChangeSupport

private java.beans.PropertyChangeSupport propertyChangeSupport
No comment provided by developer, please add a comment to improve documentation.


PROPERTY_DIR

private static final java.lang.String PROPERTY_DIR
Directory for all properties.

See Also:
Constant Field Values

CORE_PROPERTIES

private static final java.lang.String CORE_PROPERTIES
Fujaba core properties file name

See Also:
Constant Field Values

baseDir

private static java.lang.String baseDir
The directory where the options are stored.


propertyOptions

private static java.util.HashMap propertyOptions
The table where all propertiesOptions are stored.

See Also:
get(), get(String)
Constructor Detail

PreferencesProperties

private PreferencesProperties(java.lang.String fileName)
Private constructor, use get () or get(key) to get an instance.

Parameters:
fileName - No description provided
See Also:
get(), get(String)
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)
Parameters:
fileName - No description provided
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.


load

private void load(java.lang.String fileName)
Loads the options.

Parameters:
fileName - No description provided

getPropertyDir

public static java.lang.String getPropertyDir()
Get the baseDir attribute of the PropertyOptions class

Returns:
The baseDir value

getBaseDir

public static java.lang.String getBaseDir()
Getter for attribute baseDir.

Returns:
baseDir

setBaseDir

public static void setBaseDir(java.lang.String dir)
Setter for attribute baseDir.

Parameters:
dir - the directory where the option are now stored

generateDefaultSettings

private void generateDefaultSettings()
Generate Default settings for Fujaba, needs to be modified for new settings.


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