Package diva.graph.toolbox
Class GraphEventMulticaster
- java.lang.Object
-
- diva.graph.toolbox.GraphEventMulticaster
-
- All Implemented Interfaces:
GraphListener
,java.util.EventListener
public class GraphEventMulticaster extends java.lang.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:
- $Id$
- Author:
- Michael Shilman
- Pt.AcceptedRating:
- Yellow
-
-
Constructor Summary
Constructors Constructor Description GraphEventMulticaster()
Create an empty multicaster object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.java.util.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.
-
-
-
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 interfaceGraphListener
-
edgeTailChanged
public void edgeTailChanged(GraphEvent e)
Dispatch the edgeTailChanged() event to the listeners.- Specified by:
edgeTailChanged
in interfaceGraphListener
-
listeners
public java.util.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 interfaceGraphListener
-
nodeRemoved
public void nodeRemoved(GraphEvent e)
Dispatch the nodeRemoved() event to each of the listeners.- Specified by:
nodeRemoved
in interfaceGraphListener
-
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 interfaceGraphListener
-
-