com.sun.electric.tool
Class Tool

java.lang.Object
  extended by com.sun.electric.tool.Tool
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
Compaction, ERC, Extract, FillGeneratorTool, GateLayGenSettings, IOTool, LayerCoverageTool, LETool, Listener, NetworkTool, ParasiticTool, SilComp, Simulation

public class Tool
extends java.lang.Object
implements java.lang.Comparable

This class represents a Tool in Electric. It's here mostly for the name of the tool and the variables attached. The User holds variables that keep track of the currently selected object, and other useful information.


Field Summary
 Pref.Group prefs
          Preferences for this Tool
 
Constructor Summary
protected Tool(java.lang.String toolName)
          The constructor for Tool is only called by subclasses.
protected Tool(java.lang.String toolName, java.lang.String settingGroupName)
          The constructor for Tool is only called by subclasses.
 
Method Summary
 void clearAnalysis()
          Method to set this Tool to be analysis.
 void clearBackground()
          Method to set this Tool to be in the foreground.
 void clearFixErrors()
          Method to set this Tool to fix errors.
 void clearIncremental()
          Method to set this Tool to be incremental.
 void clearOn()
          Method to set this Tool to be off.
 void clearSynthesis()
          Method to set this Tool to be synthesis.
 int compareTo(java.lang.Object obj)
          Compares Tools by their definition order.
static Tool findTool(java.lang.String name)
          Method to find the Tool with a specified name.
 int getIndex()
          Method to return the index of this Tool.
static java.util.Iterator<Listener> getListeners()
          Method to return an Iterator over all of the Listener in Electric which are on.
 java.lang.String getName()
          Method to return the name of this Tool.
static int getNumTools()
          Method to return the number of Tools.
 Setting.Group getProjectSettings()
           
static java.util.Iterator<Tool> getTools()
          Method to return an Iterator over all of the Tools in Electric.
 void init()
          The initialization method for this Tool.
static void initAllTools()
          This is called once, at the start of Electric, to initialize the Tools.
 boolean isAnalysis()
          Method to tell whether this Tool does analysis.
 boolean isBackground()
          Method to tell whether this Tool is in the background.
 boolean isFixErrors()
          Method to tell whether this Tool fixes errors.
 boolean isIncremental()
          Method to tell whether this Tool is incremental.
 boolean isOn()
          Method to tell whether this Tool is on.
 boolean isSynthesis()
          Method to tell whether this Tool does synthesis.
 void setAnalysis()
          Method to set this Tool to be analysis.
 void setBackground()
          Method to set this Tool to be in the background.
 void setFixErrors()
          Method to set this Tool to fix errors.
 void setIncremental()
          Method to set this Tool to be incremental.
 void setOn()
          Method to set this Tool to be on.
 void setSynthesis()
          Method to set this Tool to be synthesis.
 void setVarInJob(ElectricObject obj, Variable.Key key, java.lang.Object newVal)
          Method to set a variable on an ElectricObject in a new Job.
static boolean testAll()
          Test interface
 java.lang.String toString()
          Returns a printable version of this Tool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

prefs

public Pref.Group prefs
Preferences for this Tool

Constructor Detail

Tool

protected Tool(java.lang.String toolName)
The constructor for Tool is only called by subclasses.

Parameters:
toolName - the name of this tool.

Tool

protected Tool(java.lang.String toolName,
               java.lang.String settingGroupName)
The constructor for Tool is only called by subclasses.

Parameters:
toolName - the name of this tool.
settingGroupName - name of Setting Group of this Tool
Method Detail

initAllTools

public static void initAllTools()
This is called once, at the start of Electric, to initialize the Tools. Because of Java's "lazy evaluation", the only way to force the Tool constructors to fire and build a proper list of Tools, each class must somehow be referenced. So, each Tool is listed here. If a new Tool is created, this must be updated.


findTool

public static Tool findTool(java.lang.String name)
Method to find the Tool with a specified name.

Parameters:
name - the name of the desired Tool.
Returns:
the Tool with that name, or null if no tool matches.

getTools

public static java.util.Iterator<Tool> getTools()
Method to return an Iterator over all of the Tools in Electric.

Returns:
an Iterator over all of the Tools in Electric.

getNumTools

public static int getNumTools()
Method to return the number of Tools.

Returns:
the number of Tools.

getListeners

public static java.util.Iterator<Listener> getListeners()
Method to return an Iterator over all of the Listener in Electric which are on.

Returns:
an Iterator over all of the Listeners in Electric which are on

getName

public java.lang.String getName()
Method to return the name of this Tool.

Returns:
the name of this Tool.

getIndex

public int getIndex()
Method to return the index of this Tool. Each tool has a 0-based index that can be used to access arrays of Tools.

Returns:
the index of this Tool.

setOn

public void setOn()
Method to set this Tool to be on. Tools that are "on" are running incrementally, and get slices and broadcasts.


clearOn

public void clearOn()
Method to set this Tool to be off. Tools that are "on" are running incrementally, and get slices and broadcasts.


isOn

public boolean isOn()
Method to tell whether this Tool is on. Tools that are "on" are running incrementally, and get slices and broadcasts.

Returns:
true if this Tool is on.

setBackground

public void setBackground()
Method to set this Tool to be in the background.


clearBackground

public void clearBackground()
Method to set this Tool to be in the foreground.


isBackground

public boolean isBackground()
Method to tell whether this Tool is in the background.

Returns:
true if this Tool is in the background.

setFixErrors

public void setFixErrors()
Method to set this Tool to fix errors.


clearFixErrors

public void clearFixErrors()
Method to set this Tool to fix errors.


isFixErrors

public boolean isFixErrors()
Method to tell whether this Tool fixes errors.

Returns:
true if this Tool fixes errors.

setIncremental

public void setIncremental()
Method to set this Tool to be incremental.


clearIncremental

public void clearIncremental()
Method to set this Tool to be incremental.


isIncremental

public boolean isIncremental()
Method to tell whether this Tool is incremental.

Returns:
true if this Tool is incremental.

setAnalysis

public void setAnalysis()
Method to set this Tool to be analysis.


clearAnalysis

public void clearAnalysis()
Method to set this Tool to be analysis.


isAnalysis

public boolean isAnalysis()
Method to tell whether this Tool does analysis.

Returns:
true if this Tool does analysis.

setSynthesis

public void setSynthesis()
Method to set this Tool to be synthesis.


clearSynthesis

public void clearSynthesis()
Method to set this Tool to be synthesis.


isSynthesis

public boolean isSynthesis()
Method to tell whether this Tool does synthesis.

Returns:
true if this Tool does synthesis.

getProjectSettings

public Setting.Group getProjectSettings()

compareTo

public int compareTo(java.lang.Object obj)
Compares Tools by their definition order.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the other Tool.
Returns:
a comparison between the Tools.

toString

public java.lang.String toString()
Returns a printable version of this Tool.

Overrides:
toString in class java.lang.Object
Returns:
a printable version of this Tool.

setVarInJob

public void setVarInJob(ElectricObject obj,
                        Variable.Key key,
                        java.lang.Object newVal)
Method to set a variable on an ElectricObject in a new Job.

Parameters:
obj - the ElectricObject on which to set the variable.
key - the Variable key.
newVal - the new value of the Variable.

init

public void init()
The initialization method for this Tool. Gets overridden by tools that want to do initialization.


testAll

public static boolean testAll()
Test interface