diva.graph.toolbox
Class GraphEventMulticaster

java.lang.Object
  extended by diva.graph.toolbox.GraphEventMulticaster
All Implemented Interfaces:
GraphListener, EventListener

public class GraphEventMulticaster
extends Object
implements GraphListener

A list of GraphListeners which is smart enough to call the correct methods on these listeners given a GraphEvent's ID.

Version:
$Revision: 1.3 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)

Constructor Summary
GraphEventMulticaster()
          Create an empty multicaster object.
 
Method Summary
 void add(GraphListener l)
          Add the given listener to the list of listeners.
 void dispatchEvent(GraphEvent e)
          Dispatch an event to the list of listeners, calling the appropriate method based on the event's ID.
 void edgeHeadChanged(GraphEvent e)
          Dispatch the edgeHeadChanged() event to the listeners.
 void edgeTailChanged(GraphEvent e)
          Dispatch the edgeTailChanged() event to the listeners.
 Iterator listeners()
          Return an iterator over the list of listeners.
 void nodeAdded(GraphEvent e)
          Dispatch the nodeAdded() event to each of the listeners.
 void nodeRemoved(GraphEvent e)
          Dispatch the nodeRemoved() event to each of the listeners.
 void remove(GraphListener l)
          Remove the given listener from the list of listeners.
 void structureChanged(GraphEvent e)
          Dispatch the structureChanged() event to each of the listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphEventMulticaster

public GraphEventMulticaster()
Create an empty multicaster object.

Method Detail

add

public void add(GraphListener l)
Add the given listener to the list of listeners.


dispatchEvent

public void dispatchEvent(GraphEvent e)
Dispatch an event to the list of listeners, calling the appropriate method based on the event's ID.


edgeHeadChanged

public void edgeHeadChanged(GraphEvent e)
Dispatch the edgeHeadChanged() event to the listeners.

Specified by:
edgeHeadChanged in interface GraphListener

edgeTailChanged

public void edgeTailChanged(GraphEvent e)
Dispatch the edgeTailChanged() event to the listeners.

Specified by:
edgeTailChanged in interface GraphListener

listeners

public Iterator listeners()
Return an iterator over the list of listeners.


nodeAdded

public void nodeAdded(GraphEvent e)
Dispatch the nodeAdded() event to each of the listeners.

Specified by:
nodeAdded in interface GraphListener

nodeRemoved

public void nodeRemoved(GraphEvent e)
Dispatch the nodeRemoved() event to each of the listeners.

Specified by:
nodeRemoved in interface GraphListener

remove

public void remove(GraphListener l)
Remove the given listener from the list of listeners.


structureChanged

public void structureChanged(GraphEvent e)
Dispatch the structureChanged() event to each of the listeners.

Specified by:
structureChanged in interface GraphListener


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.