com.sun.electric.tool.user
Class GraphicsPreferences

java.lang.Object
  extended by com.sun.electric.database.text.PrefPackage
      extended by com.sun.electric.tool.user.GraphicsPreferences
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class GraphicsPreferences
extends PrefPackage

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.electric.database.text.PrefPackage
PrefPackage.BooleanPref, PrefPackage.DoublePref, PrefPackage.IntegerPref, PrefPackage.LongPref, PrefPackage.StringPref
 
Field Summary
 java.lang.String defaultFont
          The default font to use on the display.
 int exportDisplayLevel
          How to display exports.
static java.lang.String FACTORY_DEFAULT_FONT
           
 int portDisplayLevel
          How to display ports.
static int RGB_MASK
           
 
Fields inherited from class com.sun.electric.database.text.PrefPackage
TECH_NODE, USER_NODE
 
Constructor Summary
GraphicsPreferences(boolean factory)
           
GraphicsPreferences(boolean factory, TechPool techPool)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.awt.Color getColor(User.ColorPrefType t)
          Method to get the color of a given special layer type on the display.
 java.awt.Color[] getColorMap(Technology tech)
          Returns the color map for transparent layers in specified technology.
 EGraphics getGraphics(Layer layer)
          Method to return the graphics description of specified Layer.
protected  java.lang.String getKeyIn(java.lang.String what, LayerId layerId)
           
 int getNumTransparentLayers(Technology tech)
          Returns the number of transparent layers in specified technology.
 java.awt.Color[] getTransparentLayerColors(Technology tech)
          Method to return the colors for the transparent layers in specified Technology.
 int hashCode()
           
 boolean isTextVisibilityOn(AbstractTextDescriptor.TextType t)
          Method to tell whether to draw text of particular text type.
 void putPrefs(java.util.prefs.Preferences prefRoot, boolean removeDefaults)
          Store annotated option fields of the subclass into the speciefied Preferences subtree.
 void putPrefs(java.util.prefs.Preferences prefRoot, boolean removeDefaults, GraphicsPreferences oldGp)
           
 GraphicsPreferences withColor(User.ColorPrefType t, java.awt.Color color)
           
 GraphicsPreferences withDefaultFont(java.lang.String defaultFont)
           
 GraphicsPreferences withDisplayLevelReset()
           
 GraphicsPreferences withExportDisplayLevel(int exportDisplayLevel)
           
 GraphicsPreferences withFactoryColor(User.ColorPrefType t)
           
 GraphicsPreferences withGraphics(Layer layer, EGraphics graphics)
           
 GraphicsPreferences withPortDisplayLevel(int portDisplayLevel)
           
 GraphicsPreferences withTextVisibilityOn(AbstractTextDescriptor.TextType t, boolean b)
           
 GraphicsPreferences withTransparentLayerColor(Technology tech, int transparentLayer, java.awt.Color tranparentColor)
           
 GraphicsPreferences withTransparentLayerColors(Technology tech, java.awt.Color[] tranparentColors)
           
 
Methods inherited from class com.sun.electric.database.text.PrefPackage
getFactoryPrefRoot, getKey, getKey, getKey, getKey, getPrefRoot, withField
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RGB_MASK

public static final int RGB_MASK
See Also:
Constant Field Values

portDisplayLevel

public int portDisplayLevel
How to display ports. 0: full port names (the default). 1: short port names (stopping at the first nonalphabetic character). 2: ports drawn as crosses.


exportDisplayLevel

public int exportDisplayLevel
How to display exports. 0: full export names (the default). 1: short export names (stopping at the first nonalphabetic character). 2: exports drawn as crosses.


defaultFont

public java.lang.String defaultFont
The default font to use on the display. The default is "SansSerif".


FACTORY_DEFAULT_FONT

public static final java.lang.String FACTORY_DEFAULT_FONT
See Also:
Constant Field Values
Constructor Detail

GraphicsPreferences

public GraphicsPreferences(boolean factory)

GraphicsPreferences

public GraphicsPreferences(boolean factory,
                           TechPool techPool)
Method Detail

putPrefs

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

Overrides:
putPrefs in class PrefPackage
Parameters:
prefRoot - the root of the Preferences subtree.
removeDefaults - remove from the Preferences subtree options which have factory default value.

putPrefs

public void putPrefs(java.util.prefs.Preferences prefRoot,
                     boolean removeDefaults,
                     GraphicsPreferences oldGp)

withTransparentLayerColors

public GraphicsPreferences withTransparentLayerColors(Technology tech,
                                                      java.awt.Color[] tranparentColors)

withTransparentLayerColor

public GraphicsPreferences withTransparentLayerColor(Technology tech,
                                                     int transparentLayer,
                                                     java.awt.Color tranparentColor)

withGraphics

public GraphicsPreferences withGraphics(Layer layer,
                                        EGraphics graphics)

withColor

public GraphicsPreferences withColor(User.ColorPrefType t,
                                     java.awt.Color color)

withFactoryColor

public GraphicsPreferences withFactoryColor(User.ColorPrefType t)

withTextVisibilityOn

public GraphicsPreferences withTextVisibilityOn(AbstractTextDescriptor.TextType t,
                                                boolean b)

withPortDisplayLevel

public GraphicsPreferences withPortDisplayLevel(int portDisplayLevel)

withExportDisplayLevel

public GraphicsPreferences withExportDisplayLevel(int exportDisplayLevel)

withDisplayLevelReset

public GraphicsPreferences withDisplayLevelReset()

withDefaultFont

public GraphicsPreferences withDefaultFont(java.lang.String defaultFont)

getNumTransparentLayers

public int getNumTransparentLayers(Technology tech)
Returns the number of transparent layers in specified technology. Informs the display system of the number of overlapping or transparent layers in use.

Parameters:
tech - specified Technology
Returns:
the number of transparent layers in specified technology. There may be 0 transparent layers in technologies that don't do overlapping, such as Schematics.

getTransparentLayerColors

public java.awt.Color[] getTransparentLayerColors(Technology tech)
Method to return the colors for the transparent layers in specified Technology.

Parameters:
tech - specified Technoology
Returns:
the factory for the transparent layers in this Technology.

getColorMap

public java.awt.Color[] getColorMap(Technology tech)
Returns the color map for transparent layers in specified technology.

Parameters:
tech - specified Technology
Returns:
the color map for transparent layers in specified technology. The number of entries in this map equals 2 to the power "getNumTransparentLayers()".

getGraphics

public EGraphics getGraphics(Layer layer)
Method to return the graphics description of specified Layer.

Parameters:
layer - specified Layer
Returns:
the graphics description of specified Layer.

getColor

public java.awt.Color getColor(User.ColorPrefType t)
Method to get the color of a given special layer type on the display.

Parameters:
t - layer type in question.
Returns:
color of the special layer type.

isTextVisibilityOn

public boolean isTextVisibilityOn(AbstractTextDescriptor.TextType t)
Method to tell whether to draw text of particular text type. The default is "true".

Parameters:
t - specified text type.
Returns:
true if the system should text of specified type.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getKeyIn

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