net.sf.ext.jflexsett.settings
Class Settings

java.lang.Object
  extended bynet.sf.ext.jflexsett.settings.Settings

public class Settings
extends java.lang.Object

Contains all Settings Groups and there settings. The Settings class is the only class which needs to be referenced to add groups, add settings, get settings and get values of settings.

Since:
1.4
Version:
1.9
Author:
Robert Jan van der Waals

Constructor Summary
Settings()
           
 
Method Summary
 void addGroup(java.lang.String sKey, SettingsGroup group)
          Adds a group to the hashtable.
 void addSetting(java.lang.String sGroupKey, Setting setting)
          Adds a setting to a specified group.
 java.util.Vector getFlatSettingsGroups()
          Retrieves all settings groups without an hierarchy
 Setting getSetting(java.lang.String sSettingsKey)
          Retrieves a setting
 java.util.Vector getSettings()
          Retrieves all the settings
 java.io.File getSettingsFile()
           
 java.util.LinkedHashMap getSettingsGroups()
          Retrieves all the top-level groups
 java.lang.Object getValue(java.lang.String sKey)
          Retrieves a value of a settings
 boolean getValueAsBoolean(java.lang.String sKey)
          Returns the value of the setting as a boolean
 java.awt.Color getValueAsColor(java.lang.String sKey)
          Returns the value of the setting as a color object
 java.awt.Dimension getValueAsDimension(java.lang.String sKey)
          Returns the value of the setting as a String
 java.awt.Font getValueAsFont(java.lang.String sKey)
           
 int getValueAsInt(java.lang.String sKey)
          Returns the value of the setting as an integer
 int[] getValueAsIntegerArray(java.lang.String sKey)
           
 ReportFieldDefinitions getValueAsReportFieldDefinitions(java.lang.String sKey)
           
 java.lang.String getValueAsString(java.lang.String sKey)
          Returns the value of the setting as a String
 java.lang.String[] getValueAsStringArray(java.lang.String sKey)
          Returns the value of the setting as a String array
 boolean isSettingKeyValid(java.lang.String sKey)
           
 void setSettingsFile(java.io.File file)
          Specifies the location and name of the settings file
 void setStringAsValue(java.lang.String sKey, java.lang.String sValue)
          Sets a string as a value for the setting (by parsing the string)
 void setValue(java.lang.String sKey, java.lang.Object oValue)
          Sets the value of a setting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Settings

public Settings()
Method Detail

addGroup

public void addGroup(java.lang.String sKey,
                     SettingsGroup group)
Adds a group to the hashtable. A group may contain sub-groups. Only the parent, to which a sub-group belongs, should be added.

Parameters:
sKey - unique identifier for this group
group - a top-level group (parent)

setSettingsFile

public void setSettingsFile(java.io.File file)
Specifies the location and name of the settings file

Parameters:
file - the settings file

getSettingsFile

public java.io.File getSettingsFile()

addSetting

public void addSetting(java.lang.String sGroupKey,
                       Setting setting)
Adds a setting to a specified group. A group can be either a parent or a child.

Parameters:
sGroupKey - the key of the group
setting - the setting to be added to the specified group

isSettingKeyValid

public boolean isSettingKeyValid(java.lang.String sKey)

getSetting

public Setting getSetting(java.lang.String sSettingsKey)
Retrieves a setting

Parameters:
sSettingsKey - the settings key

getValue

public java.lang.Object getValue(java.lang.String sKey)
Retrieves a value of a settings

Parameters:
sKey - the settings key

getValueAsStringArray

public java.lang.String[] getValueAsStringArray(java.lang.String sKey)
Returns the value of the setting as a String array

Parameters:
sKey - the settings key

getValueAsIntegerArray

public int[] getValueAsIntegerArray(java.lang.String sKey)

getValueAsReportFieldDefinitions

public ReportFieldDefinitions getValueAsReportFieldDefinitions(java.lang.String sKey)

getValueAsFont

public java.awt.Font getValueAsFont(java.lang.String sKey)

getValueAsInt

public int getValueAsInt(java.lang.String sKey)
Returns the value of the setting as an integer

Parameters:
sKey - the settings key

getValueAsBoolean

public boolean getValueAsBoolean(java.lang.String sKey)
Returns the value of the setting as a boolean

Parameters:
sKey - the settings key

getValueAsColor

public java.awt.Color getValueAsColor(java.lang.String sKey)
Returns the value of the setting as a color object

Parameters:
sKey - the settings key

getValueAsDimension

public java.awt.Dimension getValueAsDimension(java.lang.String sKey)
Returns the value of the setting as a String

Parameters:
sKey - the settings key

getValueAsString

public java.lang.String getValueAsString(java.lang.String sKey)
Returns the value of the setting as a String

Parameters:
sKey - the settings key

setValue

public void setValue(java.lang.String sKey,
                     java.lang.Object oValue)
Sets the value of a setting

Parameters:
sKey - the settings key
oValue - the value

setStringAsValue

public void setStringAsValue(java.lang.String sKey,
                             java.lang.String sValue)
Sets a string as a value for the setting (by parsing the string)

Parameters:
sKey - the settings key
sValue - the string value to be parsed

getSettingsGroups

public java.util.LinkedHashMap getSettingsGroups()
Retrieves all the top-level groups


getFlatSettingsGroups

public java.util.Vector getFlatSettingsGroups()
Retrieves all settings groups without an hierarchy


getSettings

public java.util.Vector getSettings()
Retrieves all the settings