com.isti.jplotresp
Class ConfigManager

java.lang.Object
  extended by com.isti.jplotresp.ConfigManager

public class ConfigManager
extends java.lang.Object

Class ConfigManager manages an XML-format configuration file.


Field Summary
 CfgPropItem ampPhaseSelProp
           
 CfgPropItem b62XValueProp
          Sample value for polynomial blockette.
 CfgPropItem beginTimeJulianDayProp
          Begin time julian day.
 CfgPropItem beginTimeTimeProp
          Begin time time.
 CfgPropItem beginTimeYearProp
          Begin time year.
protected  java.lang.String cfgFileNameStr
           
 CfgPropItem channelProp
          Channel.
 CfgPropItem combineAmpPhaseFlagProp
           
static java.lang.String CONFIG
           
static java.lang.String CONFIG_GROUP
           
protected  org.jdom.Element configRootElement
           
static int DEFAULT_AMP_PHASE_SEL_IDX
          Amp/phase selection.
static boolean DEFAULT_COMBINE_AMP_PHASE_FLAG
          Combine amp/phase flag.
static boolean DEFAULT_LOG_AMP_FLAG
          Log-amplitude flag.
static boolean DEFAULT_SHOW_FREQ_LINE_FLAG
          Show frequency line flag.
static boolean DEFAULT_SHOW_POINTS_FLAG
          Show points flag.
static java.lang.String EMPTY_TEXT
           
 CfgPropItem endStageProp
          End stage.
 CfgPropItem endTimeJulianDayProp
          End time julian day.
 CfgPropItem endTimeTimeProp
          End time time.
 CfgPropItem endTimeYearProp
          End time year.
protected  java.lang.String errorMessage
           
 CfgPropItem filenameProp
          Filename.
 CfgPropItem filenameSelectedFlagProp
          Filename selected flag.
 CfgPropItem frequencySpacingProp
          Frequency spacing.
 CfgPropItem headersProp
          Enable headers in output files.
 CfgPropItem interpInputProp
          Enable interpolation of List blockette input.
 CfgPropItem interpOutputProp
          Enable interpolation of List blockette output.
 CfgPropItem interpTensionProp
          Tension for List blockette interpolation.
protected  IstiXmlUtils istiXmlUtilsObj
           
 CfgPropItem locationProp
          Location.
 CfgPropItem logAmpFlagProp
           
 CfgPropItem maxFreqProp
          Maximum frequency.
 CfgPropItem minFreqProp
          Minimum frequency.
 CfgPropItem multiOutProp
          Remember Settings
 CfgPropItem multiSvrFlagProp
          Flag set true to fetch from all specified web-services servers.
 CfgPropItem networkProp
          Network.
 CfgPropItem numFreqProp
          Number of frequencies.
 CfgPropItem outputDirectoryProp
          Output Directory.
 CfgPropItem programFrameHeightProp
          Height of program window frame.
 CfgPropItem programFrameWidthProp
          Width of program window frame.
 CfgPropItem programFrameXPosProp
          X-position of program window frame (<0=centered).
 CfgPropItem programFrameYPosProp
          Y-position of program window frame (<0=centered).
 CfgPropItem rememberSettingsProp
          Remember Settings
 CfgPropItem responseTypeProp
          Response type.
 CfgPropItem serverFileProp
          Server.
static java.lang.String SETTINGS
           
 CfgProperties settingsProps
          Configuration properties object for Settings.
 CfgPropItem showFreqLineFlagProp
           
 CfgPropItem showInputProp
          Enable showing of RESP input text (sent to console).
 CfgPropItem showPointsFlagProp
           
 CfgPropItem startStageProp
          Start stage.
 CfgPropItem stationProp
          Station.
 CfgPropItem totalSensitFlagProp
          Flag set true to use stage 0 sensitivity instead of computed.
 CfgPropItem unitsProp
          Units.
 CfgPropItem unwrapPhaseFlagProp
          Flag set true to unwrap phase output values.
 CfgPropItem useDelayProp
          Enable use of estimated delay in phase calculation.
 CfgPropItem useIstiFileChooserFlagProp
          Use ISTI file choosers flag.
 CfgPropItem verboseProp
          Enable verbose output.
 
Constructor Summary
ConfigManager(java.lang.String cfgFileNameStr)
          Creates an object for processing XML-format configuration file.
 
Method Summary
protected  void addToComponentsTable(java.awt.Component comp, CfgPropItem cfgPropItem, boolean saveFlag)
          Add the component to the components table.
protected  void addToComponentsTable(java.awt.Component comp, CfgPropItem cfgPropItem, boolean saveFlag, boolean clrDefFlag)
          Add the component to the components table.
 void clearErrorMessage()
          Clears the error message string.
protected  java.util.Map getComponentsTable()
          Gets the components table.
 boolean getErrorFlag()
          Returns true if an error was detected.
 java.lang.String getErrorMessage()
          Returns message string for last error (or 'No error' if none).
 void loadComponentConfigSettings()
          Load the component configuration settings.
 boolean loadSettings()
          Loads the set of "name = value" items specified by the "Settings" element in the configuration file.
protected  boolean loadSettings(org.jdom.Element rootElement)
          Loads the set of "name = value" items specified by the "Settings" element in the configuration file.
 void saveComponentConfigSettings()
          Save the component configuration settings.
 boolean saveConfig()
          Save the configuration.
protected  boolean saveSettings(org.jdom.Element configElementObj)
          Saves the set of "name = value" items specified by the "Settings" element in the configuration file.
 void setAllItemsToDefaults()
          Sets value on all items to the default value.
protected  void setErrorMessage(java.lang.String str)
          Enters an error message (if none previously entered).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_TEXT

public static final java.lang.String EMPTY_TEXT
See Also:
Constant Field Values

CONFIG

public static final java.lang.String CONFIG
See Also:
Constant Field Values

SETTINGS

public static final java.lang.String SETTINGS
See Also:
Constant Field Values

CONFIG_GROUP

public static final java.lang.String CONFIG_GROUP
See Also:
Constant Field Values

cfgFileNameStr

protected final java.lang.String cfgFileNameStr

configRootElement

protected final org.jdom.Element configRootElement

istiXmlUtilsObj

protected final IstiXmlUtils istiXmlUtilsObj

errorMessage

protected java.lang.String errorMessage

settingsProps

public final CfgProperties settingsProps
Configuration properties object for Settings.


networkProp

public final CfgPropItem networkProp
Network.


stationProp

public final CfgPropItem stationProp
Station.


locationProp

public final CfgPropItem locationProp
Location.


channelProp

public final CfgPropItem channelProp
Channel.


minFreqProp

public final CfgPropItem minFreqProp
Minimum frequency.


maxFreqProp

public final CfgPropItem maxFreqProp
Maximum frequency.


numFreqProp

public final CfgPropItem numFreqProp
Number of frequencies.


beginTimeYearProp

public final CfgPropItem beginTimeYearProp
Begin time year.


beginTimeJulianDayProp

public final CfgPropItem beginTimeJulianDayProp
Begin time julian day.


beginTimeTimeProp

public final CfgPropItem beginTimeTimeProp
Begin time time.


endTimeYearProp

public final CfgPropItem endTimeYearProp
End time year.


endTimeJulianDayProp

public final CfgPropItem endTimeJulianDayProp
End time julian day.


endTimeTimeProp

public final CfgPropItem endTimeTimeProp
End time time.


rememberSettingsProp

public final CfgPropItem rememberSettingsProp
Remember Settings


multiOutProp

public final CfgPropItem multiOutProp
Remember Settings


filenameSelectedFlagProp

public final CfgPropItem filenameSelectedFlagProp
Filename selected flag.


filenameProp

public final CfgPropItem filenameProp
Filename.


serverFileProp

public final CfgPropItem serverFileProp
Server.


startStageProp

public final CfgPropItem startStageProp
Start stage.


endStageProp

public final CfgPropItem endStageProp
End stage.


verboseProp

public final CfgPropItem verboseProp
Enable verbose output.


headersProp

public final CfgPropItem headersProp
Enable headers in output files.


useDelayProp

public final CfgPropItem useDelayProp
Enable use of estimated delay in phase calculation.


multiSvrFlagProp

public final CfgPropItem multiSvrFlagProp
Flag set true to fetch from all specified web-services servers.


unwrapPhaseFlagProp

public final CfgPropItem unwrapPhaseFlagProp
Flag set true to unwrap phase output values.


totalSensitFlagProp

public final CfgPropItem totalSensitFlagProp
Flag set true to use stage 0 sensitivity instead of computed.


showInputProp

public final CfgPropItem showInputProp
Enable showing of RESP input text (sent to console).


b62XValueProp

public final CfgPropItem b62XValueProp
Sample value for polynomial blockette.


interpOutputProp

public final CfgPropItem interpOutputProp
Enable interpolation of List blockette output.


interpInputProp

public final CfgPropItem interpInputProp
Enable interpolation of List blockette input.


interpTensionProp

public final CfgPropItem interpTensionProp
Tension for List blockette interpolation.


DEFAULT_AMP_PHASE_SEL_IDX

public static final int DEFAULT_AMP_PHASE_SEL_IDX
Amp/phase selection.

See Also:
Constant Field Values

ampPhaseSelProp

public final CfgPropItem ampPhaseSelProp

DEFAULT_SHOW_POINTS_FLAG

public static final boolean DEFAULT_SHOW_POINTS_FLAG
Show points flag.

See Also:
Constant Field Values

showPointsFlagProp

public final CfgPropItem showPointsFlagProp

DEFAULT_LOG_AMP_FLAG

public static final boolean DEFAULT_LOG_AMP_FLAG
Log-amplitude flag.

See Also:
Constant Field Values

logAmpFlagProp

public final CfgPropItem logAmpFlagProp

DEFAULT_COMBINE_AMP_PHASE_FLAG

public static final boolean DEFAULT_COMBINE_AMP_PHASE_FLAG
Combine amp/phase flag.

See Also:
Constant Field Values

combineAmpPhaseFlagProp

public final CfgPropItem combineAmpPhaseFlagProp

DEFAULT_SHOW_FREQ_LINE_FLAG

public static final boolean DEFAULT_SHOW_FREQ_LINE_FLAG
Show frequency line flag.

See Also:
Constant Field Values

showFreqLineFlagProp

public final CfgPropItem showFreqLineFlagProp

unitsProp

public final CfgPropItem unitsProp
Units.


frequencySpacingProp

public final CfgPropItem frequencySpacingProp
Frequency spacing.


responseTypeProp

public final CfgPropItem responseTypeProp
Response type.


outputDirectoryProp

public final CfgPropItem outputDirectoryProp
Output Directory.


programFrameWidthProp

public final CfgPropItem programFrameWidthProp
Width of program window frame.


programFrameHeightProp

public final CfgPropItem programFrameHeightProp
Height of program window frame.


programFrameXPosProp

public final CfgPropItem programFrameXPosProp
X-position of program window frame (<0=centered).


programFrameYPosProp

public final CfgPropItem programFrameYPosProp
Y-position of program window frame (<0=centered).


useIstiFileChooserFlagProp

public final CfgPropItem useIstiFileChooserFlagProp
Use ISTI file choosers flag.

Constructor Detail

ConfigManager

public ConfigManager(java.lang.String cfgFileNameStr)
Creates an object for processing XML-format configuration file. The 'getErrorFlag()' method may be used to check if the load was successful and the 'getErrorMessage()' method may be used to retrieve an error message, if any.

Parameters:
cfgFileNameStr - the name of the XML-format input config file to read and process.
Method Detail

addToComponentsTable

protected void addToComponentsTable(java.awt.Component comp,
                                    CfgPropItem cfgPropItem,
                                    boolean saveFlag,
                                    boolean clrDefFlag)
Add the component to the components table.

Parameters:
comp - component to add.
cfgPropItem - the config property editor.
saveFlag - true to save when saving settings.
clrDefFlag - true to restore default if edit value cleared.

addToComponentsTable

protected void addToComponentsTable(java.awt.Component comp,
                                    CfgPropItem cfgPropItem,
                                    boolean saveFlag)
Add the component to the components table.

Parameters:
comp - component to add.
cfgPropItem - the config property editor.
saveFlag - true to save when saving settings.

getComponentsTable

protected java.util.Map getComponentsTable()
Gets the components table.

Returns:
the components table.

loadComponentConfigSettings

public void loadComponentConfigSettings()
Load the component configuration settings.


saveComponentConfigSettings

public void saveComponentConfigSettings()
Save the component configuration settings.


saveConfig

public boolean saveConfig()
Save the configuration.

Returns:
'true' if successful, false if an error occurred (in which case the 'getErrorMessage()' method may be used to fetch a description of the error).

loadSettings

public boolean loadSettings()
Loads the set of "name = value" items specified by the "Settings" element in the configuration file.

Returns:
'true' if successful, false if an error occurred (in which case the 'getErrorMessage()' method may be used to fetch a description of the error).

loadSettings

protected boolean loadSettings(org.jdom.Element rootElement)
Loads the set of "name = value" items specified by the "Settings" element in the configuration file.

Parameters:
rootElement - root element.
Returns:
'true' if successful, false if an error occurred (in which case the 'getErrorMessage()' method may be used to fetch a description of the error).

saveSettings

protected boolean saveSettings(org.jdom.Element configElementObj)
Saves the set of "name = value" items specified by the "Settings" element in the configuration file.

Parameters:
configElementObj - configuration element object.
Returns:
'true' if successful, false if an error occurred (in which case the 'getErrorMessage()' method may be used to fetch a description of the error).

setAllItemsToDefaults

public void setAllItemsToDefaults()
Sets value on all items to the default value.


setErrorMessage

protected void setErrorMessage(java.lang.String str)
Enters an error message (if none previously entered).

Parameters:
str - the error message.

getErrorFlag

public boolean getErrorFlag()
Returns true if an error was detected. The error message may be fetched via the 'getErrorMessage()' method.

Returns:
The flag value.

getErrorMessage

public java.lang.String getErrorMessage()
Returns message string for last error (or 'No error' if none).

Returns:
The error message.

clearErrorMessage

public void clearErrorMessage()
Clears the error message string.