com.sun.electric.tool.user.ui
Class LayerVisibility

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

public class LayerVisibility
extends PrefPackage

Class represents visibility of Layers. It is possible to have multiple instances of this class, for example for each EditWindow.

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
 
Fields inherited from class com.sun.electric.database.text.PrefPackage
TECH_NODE, USER_NODE
 
Constructor Summary
LayerVisibility(boolean factory)
           
 
Method Summary
static void factoryReset()
          Reset "standard" LayerVisibility to factory values.
static LayerVisibility getLayerVisibility()
          Returns "standard" LayerVisibility
 float getOpacity(Layer layer)
           
 java.util.List<Layer> getSavedLayerOrder(Technology tech)
          Method to return a list of layers that are saved for specified Technology.
 boolean isHighlighted(Layer layer)
          Method to tell whether a Layer is highlighted.
 boolean isVisible(ArcProto ap)
          Method to tell whether an ArcProto is visible.
 boolean isVisible(Layer layer)
          Method to tell whether a Layer is visible.
 boolean isVisible(PrimitiveNode pn)
          Method to tell whether a PrimitiveNode is visible.
static void preserveVisibility()
          Save "standard" LayerVisibility in Preferences
 void putPrefs(java.util.prefs.Preferences prefRoot, boolean removeDefaults)
          Store annotated option fields of the subclass into the speciefied Preferences subtree.
static void setDefaultOpacity()
          Reset "standard" LayerVisibility to factory values.
 void setOpacity(Layer layer, double opacity)
           
 void setSavedLayerOrder(Technology tech, java.util.List<Layer> layers)
          Method to save a list of layers for this Technology in a preferred order.
static void setTechPool(TechPool techPool)
          Reload standard LayerVisibility from Preferences
 
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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayerVisibility

public LayerVisibility(boolean factory)
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.

getSavedLayerOrder

public java.util.List<Layer> getSavedLayerOrder(Technology tech)
Method to return a list of layers that are saved for specified Technology. The saved layers are used in the "Layers" tab (which can be user-rearranged).

Parameters:
tech - specified Technology
Returns:
a list of layers for this Technology in the saved order.

setSavedLayerOrder

public void setSavedLayerOrder(Technology tech,
                               java.util.List<Layer> layers)
Method to save a list of layers for this Technology in a preferred order. This ordering is managed by the "Layers" tab which users can rearrange.

Parameters:
layers - a list of layers for this Technology in a preferred order.

setOpacity

public void setOpacity(Layer layer,
                       double opacity)

isVisible

public boolean isVisible(Layer layer)
Method to tell whether a Layer is visible.

Parameters:
layer - specified layer
Returns:
true if this Layer is visible.

isVisible

public boolean isVisible(PrimitiveNode pn)
Method to tell whether a PrimitiveNode is visible.

Parameters:
pn - specified PrimitiveNode
Returns:
true if the PrimitiveNode is visible.

isVisible

public boolean isVisible(ArcProto ap)
Method to tell whether an ArcProto is visible.

Parameters:
ap - specified ArcProto
Returns:
true if the ArcProto is visible.

isHighlighted

public boolean isHighlighted(Layer layer)
Method to tell whether a Layer is highlighted. Highlighted layers are drawn brighter

Parameters:
layer - specified layer
Returns:
true if this Layer is highlighted.

getOpacity

public float getOpacity(Layer layer)

getLayerVisibility

public static LayerVisibility getLayerVisibility()
Returns "standard" LayerVisibility

Returns:
"standard" LayerVisibility

preserveVisibility

public static void preserveVisibility()
Save "standard" LayerVisibility in Preferences


factoryReset

public static void factoryReset()
Reset "standard" LayerVisibility to factory values.


setDefaultOpacity

public static void setDefaultOpacity()
Reset "standard" LayerVisibility to factory values.


setTechPool

public static void setTechPool(TechPool techPool)
Reload standard LayerVisibility from Preferences

Parameters:
techPool - new TechPool