Cytoscape 2.8.0 API

cytoscape.visual
Class SubjectBase

java.lang.Object
  extended by cytoscape.visual.SubjectBase
Direct Known Subclasses:
AbstractMapping, CustomGraphicsManager, 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.


Field Summary
protected  List<ChangeListener> observers
          An Array List of All Observers who want to be notified of changes.
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

observers

protected final List<ChangeListener> observers
An Array List of All Observers who want to be notified of changes.

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.


Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.