Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.visual
Class SubjectBase

java.lang.Object
  extended by cytoscape.visual.SubjectBase
Direct Known Subclasses:
ContinuousMapping, DiscreteMapping, GlobalAppearanceCalculator, VisualMappingManager

public abstract class SubjectBase
extends Object

Abstract Base Class for Subject in the Subject / Observer Pattern. Also Known as Publisher / Subscriber Pattern. A Subject class notifies all its subscribers whenever its state changes. Note that this code duplicates some code in the AbstractCalculator class. May be a good place to refactor in the future.


Constructor Summary
SubjectBase()
           
 
Method Summary
 void addChangeListener(ChangeListener listener)
          Add a ChangeListener.
 void fireStateChanged()
          Notifies all listeners that have registered interest for notification on this event type.
 void removeChangeListener(ChangeListener listener)
          Remove a ChangeListener from the calcaultor.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubjectBase

public SubjectBase()
Method Detail

addChangeListener

public void addChangeListener(ChangeListener listener)
Add a ChangeListener. When the state underlying the calculator changes, all ChangeListeners will be notified.

Parameters:
listener - ChangeListener to add

removeChangeListener

public void removeChangeListener(ChangeListener listener)
Remove a ChangeListener from the calcaultor. When the state underlying the calculator changes, all ChangeListeners will be notified.

Parameters:
listener - ChangeListener to add

fireStateChanged

public void fireStateChanged()
Notifies all listeners that have registered interest for notification on this event type.


www.cytoscape.org