com.sun.electric.database.text
Class PrefPackage

java.lang.Object
  extended by com.sun.electric.database.text.PrefPackage
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ComponentMenu.ComponentMenuPreferences, DRC.DRCPreferences, EditingPreferences, ERCAntenna.AntennaPreferences, ERCWellCheck.WellCheckPreferences, GenerateVHDL.VHDLPreferences, GraphicsPreferences, LayerCoverageTool.LayerCoveragePreferences, LayerVisibility, SilComp.SilCompPrefs

public abstract class PrefPackage
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Abstract class to define a package of appearence options. Subclass can define Java annotations on its fields, describing their persistence representation in Java Preferences.

See Also:
Serialized Form

Nested Class Summary
protected static interface PrefPackage.BooleanPref
          Indicates that a field declaration is intended to keep value of a boolean option.
protected static interface PrefPackage.DoublePref
          Indicates that a field declaration is intended to keep value of a double option.
protected static interface PrefPackage.IntegerPref
          Indicates that a field declaration is intended to keep value of an integer option.
protected static interface PrefPackage.LongPref
          Indicates that a field declaration is intended to keep value of a long option.
protected static interface PrefPackage.StringPref
          Indicates that a field declaration is intended to keep value of a String option.
 
Field Summary
protected static java.lang.String TECH_NODE
           
protected static java.lang.String USER_NODE
           
 
Constructor Summary
protected PrefPackage(boolean factory)
          Protected constuctor fills annotated option fields of the subclass from Preferences subtree.
protected PrefPackage(java.util.prefs.Preferences prefRoot)
          Protected constuctor fills annotated option fields of the subclass from Preferences subtree.
 
Method Summary
static java.util.prefs.Preferences getFactoryPrefRoot()
          Returns the root of dummy Preferences subtree with factory default Electric options.
protected  java.lang.String getKey(java.lang.String what, ArcProtoId apId)
           
protected  java.lang.String getKey(java.lang.String what, LayerId layerId)
           
protected  java.lang.String getKey(java.lang.String what, PrimitiveNodeId pnId)
           
protected  java.lang.String getKey(java.lang.String what, TechId techId)
           
static java.util.prefs.Preferences getPrefRoot()
          Returns the root of Preferences subtree with Electric options.
 void putPrefs(java.util.prefs.Preferences prefRoot, boolean removeDefaults)
          Store annotated option fields of the subclass into the speciefied Preferences subtree.
protected  PrefPackage withField(java.lang.String fieldName, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TECH_NODE

protected static final java.lang.String TECH_NODE
See Also:
Constant Field Values

USER_NODE

protected static final java.lang.String USER_NODE
See Also:
Constant Field Values
Constructor Detail

PrefPackage

protected PrefPackage(boolean factory)
Protected constuctor fills annotated option fields of the subclass from Preferences subtree. Now possible root can be obtained by Pref.getPrefRoot() and Pref.getFactoryPrefRoot() methods.

Parameters:
factory - use the Factory Pref root

PrefPackage

protected PrefPackage(java.util.prefs.Preferences prefRoot)
Protected constuctor fills annotated option fields of the subclass from Preferences subtree. Now possible root can be obtained by Pref.getPrefRoot() and Pref.getFactoryPrefRoot() methods.

Parameters:
prefRoot - the root of the Preferences subtree.
Method Detail

withField

protected PrefPackage withField(java.lang.String fieldName,
                                java.lang.Object value)

putPrefs

public void putPrefs(java.util.prefs.Preferences prefRoot,
                     boolean removeDefaults)
Store annotated option fields of the subclass into the speciefied Preferences subtree.

Parameters:
prefRoot - the root of the Preferences subtree.
removeDefaults - remove from the Preferences subtree options which have factory default value.

getPrefRoot

public static java.util.prefs.Preferences getPrefRoot()
Returns the root of Preferences subtree with Electric options. Currently this is "/com/sun/electric/" subtree.

Returns:
the root of Preferences subtree with Electric options.

getFactoryPrefRoot

public static java.util.prefs.Preferences getFactoryPrefRoot()
Returns the root of dummy Preferences subtree with factory default Electric options.

Returns:
the root of Preferences subtree with factory default Electric options.

getKey

protected java.lang.String getKey(java.lang.String what,
                                  TechId techId)

getKey

protected java.lang.String getKey(java.lang.String what,
                                  LayerId layerId)

getKey

protected java.lang.String getKey(java.lang.String what,
                                  PrimitiveNodeId pnId)

getKey

protected java.lang.String getKey(java.lang.String what,
                                  ArcProtoId apId)