com.sun.electric.tool
Class Listener

java.lang.Object
  extended by com.sun.electric.tool.Tool
      extended by com.sun.electric.tool.Listener
All Implemented Interfaces:
Changes, java.lang.Comparable
Direct Known Subclasses:
CVS, DRC, Project, Routing, User

public abstract class Listener
extends Tool
implements Changes

This class represents a Listener - a Tool which can listen to Changes.


Field Summary
 
Fields inherited from class com.sun.electric.tool.Tool
prefs
 
Constructor Summary
protected Listener(java.lang.String toolName)
          The constructor for Listener is only called by subclasses.
 
Method Summary
abstract  void endBatch(Snapshot oldSnapshot, Snapshot newSnapshot, boolean undoRedo)
          Handles database changes of a Job.
 void eraseLibrary(Library lib)
          Method to announce that a Library is about to be erased.
 void examineCell(Cell cell)
          Method to examine a cell because it has changed.
 void killObject(ElectricObject obj)
          Method to handle the deletion of an ElectricObject.
 void modifyArcInst(ArcInst ai, ImmutableArcInst oD)
          Method to handle a change to an ArcInst.
 void modifyCell(Cell cell, ImmutableCell oD)
          Method to handle a change to a Cell.
 void modifyCellGroup(Cell cell, Cell.CellGroup oCellGroup)
          Method to announce a move of a Cell int CellGroup.
 void modifyExport(Export pp, ImmutableExport oD)
          Method to handle a change to an Export.
 void modifyLibrary(Library lib, ImmutableLibrary oldD)
          Method to handle a change to a Library.
 void modifyNodeInst(NodeInst ni, ImmutableNodeInst oD)
          Method to handle a change to a NodeInst.
 void newObject(ElectricObject obj)
          Method to handle the creation of a new ElectricObject.
 void readLibrary(Library lib)
          Method to announce that a Library has been read.
 void renameObject(ElectricObject obj, java.lang.Object oldName)
          Method to handle the renaming of an ElectricObject.
 void request(java.lang.String cmd)
          Method to make a request of a constraint system (not used).
 void slice()
          Method to give a constraint system a chance to run.
 void startBatch(Tool tool, boolean undoRedo)
          Method to handle the start of a batch of changes.
 void writeLibrary(Library lib)
          Method to announce that a Library is about to be written to disk.
 
Methods inherited from class com.sun.electric.tool.Tool
clearAnalysis, clearBackground, clearFixErrors, clearIncremental, clearOn, clearSynthesis, compareTo, findTool, getIndex, getListeners, getName, getNumTools, getProjectSettings, getTools, init, initAllTools, initProjectSettings, isAnalysis, isBackground, isFixErrors, isIncremental, isOn, isSynthesis, makeBooleanSetting, makeDoubleSetting, makeIntSetting, makeLongSetting, makeStringSetting, setAnalysis, setBackground, setFixErrors, setIncremental, setOn, setSynthesis, setVarInJob, testAll, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.electric.database.change.Changes
init
 

Constructor Detail

Listener

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

Parameters:
toolName - the name of this listener.
Method Detail

request

public void request(java.lang.String cmd)
Method to make a request of a constraint system (not used).

Specified by:
request in interface Changes
Parameters:
cmd - the command request.

examineCell

public void examineCell(Cell cell)
Method to examine a cell because it has changed.

Specified by:
examineCell in interface Changes
Parameters:
cell - the Cell to examine.

slice

public void slice()
Method to give a constraint system a chance to run.

Specified by:
slice in interface Changes

startBatch

public void startBatch(Tool tool,
                       boolean undoRedo)
Method to handle the start of a batch of changes.

Specified by:
startBatch in interface Changes
Parameters:
tool - the tool that generated the changes.
undoRedo - true if these changes are from an undo or redo command.

endBatch

public abstract void endBatch(Snapshot oldSnapshot,
                              Snapshot newSnapshot,
                              boolean undoRedo)
Handles database changes of a Job.

Specified by:
endBatch in interface Changes
Parameters:
oldSnapshot - database snapshot before Job.
newSnapshot - database snapshot after Job and constraint propagation.
undoRedo - true if Job was Undo/Redo job.

modifyNodeInst

public void modifyNodeInst(NodeInst ni,
                           ImmutableNodeInst oD)
Method to handle a change to a NodeInst.

Specified by:
modifyNodeInst in interface Changes
Parameters:
ni - the NodeInst that was changed.
oD - the old contents of the NodeInst.

modifyArcInst

public void modifyArcInst(ArcInst ai,
                          ImmutableArcInst oD)
Method to handle a change to an ArcInst.

Specified by:
modifyArcInst in interface Changes
Parameters:
ai - the ArcInst that changed.
oD - the old contents of the ArcInst.

modifyExport

public void modifyExport(Export pp,
                         ImmutableExport oD)
Method to handle a change to an Export.

Specified by:
modifyExport in interface Changes
Parameters:
pp - the Export that moved.
oD - the old contents of the Export.

modifyCell

public void modifyCell(Cell cell,
                       ImmutableCell oD)
Method to handle a change to a Cell.

Specified by:
modifyCell in interface Changes
Parameters:
cell - the Cell that was changed.
oD - the old contents of the Cell.

modifyCellGroup

public void modifyCellGroup(Cell cell,
                            Cell.CellGroup oCellGroup)
Method to announce a move of a Cell int CellGroup.

Specified by:
modifyCellGroup in interface Changes
Parameters:
cell - the cell that was moved.
oCellGroup - the old CellGroup of the Cell.

modifyLibrary

public void modifyLibrary(Library lib,
                          ImmutableLibrary oldD)
Method to handle a change to a Library.

Specified by:
modifyLibrary in interface Changes
Parameters:
lib - the Library that was changed.
oldD - the old contents of the Library.

newObject

public void newObject(ElectricObject obj)
Method to handle the creation of a new ElectricObject.

Specified by:
newObject in interface Changes
Parameters:
obj - the ElectricObject that was just created.

killObject

public void killObject(ElectricObject obj)
Method to handle the deletion of an ElectricObject.

Specified by:
killObject in interface Changes
Parameters:
obj - the ElectricObject that was just deleted.

renameObject

public void renameObject(ElectricObject obj,
                         java.lang.Object oldName)
Method to handle the renaming of an ElectricObject.

Specified by:
renameObject in interface Changes
Parameters:
obj - the ElectricObject that was renamed.
oldName - the former name of that ElectricObject.

readLibrary

public void readLibrary(Library lib)
Method to announce that a Library has been read.

Specified by:
readLibrary in interface Changes
Parameters:
lib - the Library that was read.

eraseLibrary

public void eraseLibrary(Library lib)
Method to announce that a Library is about to be erased.

Specified by:
eraseLibrary in interface Changes
Parameters:
lib - the Library that will be erased.

writeLibrary

public void writeLibrary(Library lib)
Method to announce that a Library is about to be written to disk. The method should always be called inside of a Job so that the implementation can make changes to the database.

Specified by:
writeLibrary in interface Changes
Parameters:
lib - the Library that will be saved.