|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cytoscape.visual.SubjectBase
public abstract class SubjectBase
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 |
---|
protected final List<ChangeListener> observers
Constructor Detail |
---|
public SubjectBase()
Method Detail |
---|
public void addChangeListener(ChangeListener listener)
listener
- ChangeListener to addpublic void removeChangeListener(ChangeListener listener)
listener
- ChangeListener to addpublic void fireStateChanged()
|
Cytoscape 2.8.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |