com.sun.electric.database.text
Class Setting

java.lang.Object
  extended by com.sun.electric.database.text.Setting

public class Setting
extends java.lang.Object

This class manages meaning options. There are two types of options: appearance and meaning. Appearance options affect the way that the design is presented to the user. Meaning options affect the way that a design is produced (for fabrication, simulation, and other outputs). Examples are CIF layer names, technology options, etc.) Settings are grouped in a Setting Trees. Each Tree consists of a RootGroup and lower Groups.


Nested Class Summary
static class Setting.Group
          This class manages a group of Settings.
static class Setting.RootGroup
          This class manages a tree of Settings.
static class Setting.SettingChangeBatch
           
 
Constructor Summary
protected Setting(java.lang.String prefName, java.lang.String prefGroup, Setting.Group xmlGroup, java.lang.String xmlName, java.lang.String location, java.lang.String description, java.lang.Object factoryObj, java.lang.String... trueMeaning)
          Creates a new instance of Setting
 
Method Summary
 boolean getBoolean()
          Method to get the boolean value on this Setting object.
 java.lang.String getDescription()
          Method to return the description of this Meaning option.
 double getDouble()
          Method to get the double value on this Setting object.
 double getDoubleFactoryValue()
          Method to get the factory-default double value of this Pref object.
 java.lang.Object getFactoryValue()
          Method to get the factory-default value of this Pref object.
 int getInt()
          Method to get the integer value on this Setting object.
 java.lang.String getLocation()
          Method to return the user-command that can affect this Meaning option.
 long getLong()
          Method to get the long value on this Setting object.
 java.lang.String getPrefName()
          Method to get the name of this Setting object.
 java.lang.String getPrefPath()
          Method to get the pref name of this Setting object.
 java.lang.String getString()
          Method to get the string value on this Setting object.
 java.lang.String[] getTrueMeaning()
          Method to return an array of strings to be used for integer Meaning options.
 java.lang.Object getValue()
          Method to get the value of this Setting object as an Object.
 java.lang.Object getValueFromPreferences(java.util.prefs.Preferences prefRoot)
           
 java.lang.String getXmlPath()
          Method to get the xml name of this Setting object.
 boolean isValidOption()
          Method to tell whether this Meaning option is valid and should be reconciled.
static Setting.RootGroup read(IdReader reader)
          Reads a Tree of Settings fro, IdManager reader
 void saveToPreferences(java.util.prefs.Preferences prefRoot, java.lang.Object v)
           
 void setValidOption(boolean valid)
          Method to set whether this Meaning option is valid and should be reconciled.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Setting

protected Setting(java.lang.String prefName,
                  java.lang.String prefGroup,
                  Setting.Group xmlGroup,
                  java.lang.String xmlName,
                  java.lang.String location,
                  java.lang.String description,
                  java.lang.Object factoryObj,
                  java.lang.String... trueMeaning)
Creates a new instance of Setting

Method Detail

read

public static Setting.RootGroup read(IdReader reader)
                              throws java.io.IOException
Reads a Tree of Settings fro, IdManager reader

Parameters:
reader - IdManager reader
Throws:
java.io.IOException - om reader error

getBoolean

public boolean getBoolean()
Method to get the boolean value on this Setting object. The object must have been created as "boolean".

Returns:
the boolean value on this TechSetting object.

getInt

public int getInt()
Method to get the integer value on this Setting object. The object must have been created as "integer".

Returns:
the integer value on this TechSetting object.

getLong

public long getLong()
Method to get the long value on this Setting object. The object must have been created as "long".

Returns:
the long value on this TechSetting object.

getDouble

public double getDouble()
Method to get the double value on this Setting object. The object must have been created as "double".

Returns:
the double value on this TechSetting object.

getString

public java.lang.String getString()
Method to get the string value on this Setting object. The object must have been created as "string".

Returns:
the string value on this TechSetting object.

getValue

public java.lang.Object getValue()
Method to get the value of this Setting object as an Object. The proper way to get the current value is to use one of the type-specific methods such as getInt(), getBoolean(), etc.

Returns:
the Object value of this Setting object.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getXmlPath

public java.lang.String getXmlPath()
Method to get the xml name of this Setting object.

Returns:
the xml name of this Setting object.

getPrefName

public java.lang.String getPrefName()
Method to get the name of this Setting object.

Returns:
the name of this Setting object.

getPrefPath

public java.lang.String getPrefPath()
Method to get the pref name of this Setting object.

Returns:
the name of this Setting object.

getLocation

public java.lang.String getLocation()
Method to return the user-command that can affect this Meaning option.

Returns:
the user-command that can affect this Meaning option.

getDescription

public java.lang.String getDescription()
Method to return the description of this Meaning option.

Returns:
the Pref description of this Meaning option.

setValidOption

public void setValidOption(boolean valid)
Method to set whether this Meaning option is valid and should be reconciled. Some should not, for example, the scale value on technologies that don't use scaling (such as Schematics, Artwork, etc.)

Parameters:
valid - true if this Meaning option is valid and should be reconciled.

isValidOption

public boolean isValidOption()
Method to tell whether this Meaning option is valid and should be reconciled. Some should not, for example, the scale value on technologies that don't use scaling (such as Schematics, Artwork, etc.)

Returns:
true if this Meaning option is valid and should be reconciled.

getTrueMeaning

public java.lang.String[] getTrueMeaning()
Method to return an array of strings to be used for integer Meaning options. Some options are multiple-choice, for example the MOSIS CMOS rule set which can be 0, 1, or 2 depending on whether the set is SCMOS, Submicron, or Deep. By giving an array of 3 strings to this method, a proper description of the option can be given to the user.

Returns:
the array of strings that should be used for this integer Meaning option.

getFactoryValue

public java.lang.Object getFactoryValue()
Method to get the factory-default value of this Pref object.

Returns:
the factory-default value of this Pref object.

getDoubleFactoryValue

public double getDoubleFactoryValue()
Method to get the factory-default double value of this Pref object.

Returns:
the factory-default double value of this Pref object.

saveToPreferences

public void saveToPreferences(java.util.prefs.Preferences prefRoot,
                              java.lang.Object v)

getValueFromPreferences

public java.lang.Object getValueFromPreferences(java.util.prefs.Preferences prefRoot)