org.jscience.architecture.traffic
Class GeneralSettings

java.lang.Object
  extended by org.jscience.architecture.traffic.GeneralSettings
All Implemented Interfaces:
Settings, XMLSerializable

public class GeneralSettings
extends java.lang.Object
implements Settings

This class manages the general settings


Field Summary
protected  java.lang.String browserCommand
          Name and command for starting an external browser.
protected  java.lang.String browserName
          Name and command for starting an external browser.
static int COMPRESSION_GZIP
          DOCUMENT ME!
static int COMPRESSION_NO
          DOCUMENT ME!
protected  int compressionMethod
          Compression method to use on the XML files we generate (see constants above
static Settings currentSettings
          DOCUMENT ME!
static java.lang.String settingsFile
          DOCUMENT ME!
protected  boolean sound
          Sound on/off
protected  java.lang.String standardPath
          The standard path for file dialogs
protected  boolean useInternalHelpBrowser
          Indicates if we should use our (slow) internal browser to show the help files
 
Constructor Summary
GeneralSettings()
          Create empty GeneralSettings (for loading)
 
Method Summary
 void doLoad()
          DOCUMENT ME!
 void doSave()
          DOCUMENT ME!
static Settings getCurrentSettings()
          Gets the current settings
 boolean getPropertyBooleanValue(java.lang.String name)
          DOCUMENT ME!
 float getPropertyFloatValue(java.lang.String name)
          DOCUMENT ME!
 int getPropertyIntValue(java.lang.String name)
          DOCUMENT ME!
 java.lang.String getPropertyStringValue(java.lang.String name)
          DOCUMENT ME!
 java.lang.String getXMLName()
          DOCUMENT ME!
 boolean isPredefined()
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          DOCUMENT ME!
 void saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setParentName(java.lang.String parentName)
          DOCUMENT ME!
 void setProperty(java.lang.String name, boolean value)
          DOCUMENT ME!
 void setProperty(java.lang.String name, int value)
          DOCUMENT ME!
 void setProperty(java.lang.String name, java.lang.String value)
          DOCUMENT ME!
 void setPropertyFloatValue(java.lang.String name, float value)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPRESSION_NO

public static final int COMPRESSION_NO
DOCUMENT ME!

See Also:
Constant Field Values

COMPRESSION_GZIP

public static final int COMPRESSION_GZIP
DOCUMENT ME!

See Also:
Constant Field Values

settingsFile

public static final java.lang.String settingsFile
DOCUMENT ME!

See Also:
Constant Field Values

currentSettings

public static Settings currentSettings
DOCUMENT ME!


useInternalHelpBrowser

protected boolean useInternalHelpBrowser
Indicates if we should use our (slow) internal browser to show the help files


sound

protected boolean sound
Sound on/off


browserName

protected java.lang.String browserName
Name and command for starting an external browser. These values only have meaning if the internal browser is off


browserCommand

protected java.lang.String browserCommand
Name and command for starting an external browser. These values only have meaning if the internal browser is off


compressionMethod

protected int compressionMethod
Compression method to use on the XML files we generate (see constants above


standardPath

protected java.lang.String standardPath
The standard path for file dialogs

Constructor Detail

GeneralSettings

public GeneralSettings()
Create empty GeneralSettings (for loading)

Method Detail

getCurrentSettings

public static Settings getCurrentSettings()
Gets the current settings

Returns:
DOCUMENT ME!

doLoad

public void doLoad()
            throws java.io.IOException,
                   XMLTreeException,
                   XMLInvalidInputException
DOCUMENT ME!

Specified by:
doLoad in interface Settings
Throws:
java.io.IOException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!

doSave

public void doSave()
            throws java.io.IOException,
                   XMLTreeException,
                   XMLCannotSaveException
DOCUMENT ME!

Specified by:
doSave in interface Settings
Throws:
java.io.IOException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!

isPredefined

public boolean isPredefined()
DOCUMENT ME!

Specified by:
isPredefined in interface Settings
Returns:
DOCUMENT ME!

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
                 throws java.util.NoSuchElementException
DOCUMENT ME!

Specified by:
setProperty in interface Settings
Parameters:
name - DOCUMENT ME!
value - DOCUMENT ME!
Throws:
java.util.NoSuchElementException - DOCUMENT ME!

setProperty

public void setProperty(java.lang.String name,
                        int value)
                 throws java.util.NoSuchElementException
DOCUMENT ME!

Specified by:
setProperty in interface Settings
Parameters:
name - DOCUMENT ME!
value - DOCUMENT ME!
Throws:
java.util.NoSuchElementException - DOCUMENT ME!

setProperty

public void setProperty(java.lang.String name,
                        boolean value)
                 throws java.util.NoSuchElementException
DOCUMENT ME!

Specified by:
setProperty in interface Settings
Parameters:
name - DOCUMENT ME!
value - DOCUMENT ME!
Throws:
java.util.NoSuchElementException - DOCUMENT ME!

setPropertyFloatValue

public void setPropertyFloatValue(java.lang.String name,
                                  float value)
                           throws java.util.NoSuchElementException
DOCUMENT ME!

Parameters:
name - DOCUMENT ME!
value - DOCUMENT ME!
Throws:
java.util.NoSuchElementException - DOCUMENT ME!

getPropertyStringValue

public java.lang.String getPropertyStringValue(java.lang.String name)
                                        throws java.util.NoSuchElementException
DOCUMENT ME!

Specified by:
getPropertyStringValue in interface Settings
Parameters:
name - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.util.NoSuchElementException - DOCUMENT ME!

getPropertyBooleanValue

public boolean getPropertyBooleanValue(java.lang.String name)
                                throws java.util.NoSuchElementException
DOCUMENT ME!

Specified by:
getPropertyBooleanValue in interface Settings
Parameters:
name - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.util.NoSuchElementException - DOCUMENT ME!

getPropertyIntValue

public int getPropertyIntValue(java.lang.String name)
                        throws java.util.NoSuchElementException
DOCUMENT ME!

Specified by:
getPropertyIntValue in interface Settings
Parameters:
name - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.util.NoSuchElementException - DOCUMENT ME!

getPropertyFloatValue

public float getPropertyFloatValue(java.lang.String name)
                            throws java.util.NoSuchElementException
DOCUMENT ME!

Specified by:
getPropertyFloatValue in interface Settings
Parameters:
name - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.util.NoSuchElementException - DOCUMENT ME!

load

public void load(XMLElement myElement,
                 XMLLoader loader)
          throws XMLTreeException,
                 java.io.IOException,
                 XMLInvalidInputException
DOCUMENT ME!

Specified by:
load in interface XMLSerializable
Parameters:
myElement - DOCUMENT ME!
loader - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!

saveSelf

public XMLElement saveSelf()
                    throws XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveSelf in interface XMLSerializable
Returns:
DOCUMENT ME!
Throws:
XMLCannotSaveException - DOCUMENT ME!

saveChilds

public void saveChilds(XMLSaver saver)
                throws XMLTreeException,
                       java.io.IOException,
                       XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveChilds in interface XMLSerializable
Parameters:
saver - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!

getXMLName

public java.lang.String getXMLName()
DOCUMENT ME!

Specified by:
getXMLName in interface XMLSerializable
Returns:
DOCUMENT ME!

setParentName

public void setParentName(java.lang.String parentName)
                   throws XMLTreeException
DOCUMENT ME!

Specified by:
setParentName in interface XMLSerializable
Parameters:
parentName - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!