com.sun.electric.database.text
Class Setting

java.lang.Object
  extended by com.sun.electric.database.text.Setting
Direct Known Subclasses:
Technology.TechSetting

public class Setting
extends java.lang.Object


Nested Class Summary
static class Setting.SettingChangeBatch
           
 
Field Summary
static java.util.Comparator<Setting> SETTINGS_BY_PREF_NAME
           
 
Constructor Summary
Setting(java.lang.String prefName, Pref.Group group, java.lang.String xmlNode, java.lang.String xmlName, java.lang.String location, java.lang.String description, java.lang.Object factoryObj)
          Creates a new instance of Setting
 
Method Summary
static void finishSettingReconcilation(java.util.Map<Setting,java.lang.Object> settingsToReconcile)
          This method is called after reconciling project settings with OptionReconcile dialog or in a batch mode
 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.
static Setting getSetting(java.lang.String xmlPath)
          Method to find the project Setting object by its xml path.
static Setting getSettingByPrefPath(java.lang.String prefPath)
          Method to find the project Setting object by its pref path.
static java.util.Collection<Setting> getSettings()
           
 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.String getXmlPath()
          Method to get the xml name of this Setting object.
static void implementSettingChanges(Setting.SettingChangeBatch batch)
          Method to make a collection of project settings changes.
 boolean isValidOption()
          Method to tell whether this Meaning option is valid and should be reconciled.
static Setting makeBooleanSetting(java.lang.String name, Pref.Group group, java.lang.String xmlNode, java.lang.String xmlName, java.lang.String location, java.lang.String description, boolean factory)
          Factory methods to create a boolean project setting objects.
static Setting makeDoubleSetting(java.lang.String name, Pref.Group group, java.lang.String xmlNode, java.lang.String xmlName, java.lang.String location, java.lang.String description, double factory)
          Factory methods to create a double project setting objects.
static Setting makeIntSetting(java.lang.String name, Pref.Group group, java.lang.String xmlNode, java.lang.String xmlName, java.lang.String location, java.lang.String description, int factory)
          Factory methods to create an integerproject setting objects.
static Setting makeLongSetting(java.lang.String name, Pref.Group group, java.lang.String xmlNode, java.lang.String xmlName, java.lang.String location, java.lang.String description, long factory)
          Factory methods to create a long project setting objects.
static Setting makeStringSetting(java.lang.String name, Pref.Group group, java.lang.String xmlNode, java.lang.String xmlName, java.lang.String location, java.lang.String description, java.lang.String factory)
          Factory methods to create a string project setting objects.
static java.util.Map<Setting,java.lang.Object> reconcileSettings(java.util.Map<Setting,java.lang.Object> projectSettings)
          Method to adjust project that were saved with a library.
static java.util.Map<Setting,java.lang.Object> resetContext()
           
static void restoreContext(java.util.Map<Setting,java.lang.Object> savedContext)
           
 void set(java.lang.Object v)
           
protected  void setSideEffect()
          Method called when this Pref is changed.
 void setTrueMeaning(java.lang.String[] trueMeaning)
          Method to associate an array of strings to be used for integer Meaning options.
 void setValidOption(boolean valid)
          Method to set whether this Meaning option is valid and should be reconciled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SETTINGS_BY_PREF_NAME

public static java.util.Comparator<Setting> SETTINGS_BY_PREF_NAME
Constructor Detail

Setting

public Setting(java.lang.String prefName,
               Pref.Group group,
               java.lang.String xmlNode,
               java.lang.String xmlName,
               java.lang.String location,
               java.lang.String description,
               java.lang.Object factoryObj)
Creates a new instance of Setting

Method Detail

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.

set

public void set(java.lang.Object v)

setSideEffect

protected void setSideEffect()
Method called when this Pref is changed. This method is overridden in subclasses that want notification.


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.

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.

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.

setTrueMeaning

public void setTrueMeaning(java.lang.String[] trueMeaning)
Method to associate an array of strings to be used for integer Meaning options.

Parameters:
trueMeaning - the array of strings that should be used for this integer Meaning option. 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.

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.

makeBooleanSetting

public static Setting makeBooleanSetting(java.lang.String name,
                                         Pref.Group group,
                                         java.lang.String xmlNode,
                                         java.lang.String xmlName,
                                         java.lang.String location,
                                         java.lang.String description,
                                         boolean factory)
Factory methods to create a boolean project setting objects.

Parameters:
name - the name of this Pref.
group - group of preferences to which a new Pref belongs
location - the user-command that can affect this meaning option.
description - the description of this meaning option.
factory - the "factory" default value (if nothing is stored).

makeIntSetting

public static Setting makeIntSetting(java.lang.String name,
                                     Pref.Group group,
                                     java.lang.String xmlNode,
                                     java.lang.String xmlName,
                                     java.lang.String location,
                                     java.lang.String description,
                                     int factory)
Factory methods to create an integerproject setting objects.

Parameters:
name - the name of this Pref.
group - group of preferences to which a new Pref belongs
location - the user-command that can affect this meaning option.
description - the description of this meaning option.
factory - the "factory" default value (if nothing is stored).

makeLongSetting

public static Setting makeLongSetting(java.lang.String name,
                                      Pref.Group group,
                                      java.lang.String xmlNode,
                                      java.lang.String xmlName,
                                      java.lang.String location,
                                      java.lang.String description,
                                      long factory)
Factory methods to create a long project setting objects.

Parameters:
name - the name of this Pref.
group - group of preferences to which a new Pref belongs
location - the user-command that can affect this meaning option.
description - the description of this meaning option.
factory - the "factory" default value (if nothing is stored).

makeDoubleSetting

public static Setting makeDoubleSetting(java.lang.String name,
                                        Pref.Group group,
                                        java.lang.String xmlNode,
                                        java.lang.String xmlName,
                                        java.lang.String location,
                                        java.lang.String description,
                                        double factory)
Factory methods to create a double project setting objects.

Parameters:
name - the name of this Pref.
group - group of preferences to which a new Pref belongs
location - the user-command that can affect this meaning option.
description - the description of this meaning option.
factory - the "factory" default value (if nothing is stored).

makeStringSetting

public static Setting makeStringSetting(java.lang.String name,
                                        Pref.Group group,
                                        java.lang.String xmlNode,
                                        java.lang.String xmlName,
                                        java.lang.String location,
                                        java.lang.String description,
                                        java.lang.String factory)
Factory methods to create a string project setting objects.

Parameters:
name - the name of this Pref.
group - group of preferences to which a new Pref belongs
location - the user-command that can affect this meaning option.
description - the description of this meaning option.
factory - the "factory" default value (if nothing is stored).

getSetting

public static Setting getSetting(java.lang.String xmlPath)
Method to find the project Setting object by its xml path.

Parameters:
xmlPath - the xml path of the desired project Setting object.
Returns:
the project Setting object.

getSettingByPrefPath

public static Setting getSettingByPrefPath(java.lang.String prefPath)
Method to find the project Setting object by its pref path.

Parameters:
prefPath - the pref path of the desired project Setting object.
Returns:
the project Setting object.

reconcileSettings

public static java.util.Map<Setting,java.lang.Object> reconcileSettings(java.util.Map<Setting,java.lang.Object> projectSettings)
Method to adjust project that were saved with a library. Presents the user with a dialog to help reconcile the difference between project settings stored in a library and the original values.


finishSettingReconcilation

public static void finishSettingReconcilation(java.util.Map<Setting,java.lang.Object> settingsToReconcile)
This method is called after reconciling project settings with OptionReconcile dialog or in a batch mode


implementSettingChanges

public static void implementSettingChanges(Setting.SettingChangeBatch batch)
Method to make a collection of project settings changes. In order to make project settings changes on the server, it is necessary to gather them on the client, and send the changes to the server for actual change. This method runs on the server.

Parameters:
batch - the collection of project setting changes.

resetContext

public static java.util.Map<Setting,java.lang.Object> resetContext()

restoreContext

public static void restoreContext(java.util.Map<Setting,java.lang.Object> savedContext)

getSettings

public static java.util.Collection<Setting> getSettings()