Class 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.
      • 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.
      • 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 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.