Class AbstractEdgeListener

java.lang.Object
org.graffiti.event.AbstractEdgeListener
All Implemented Interfaces:
EventListener, EdgeListener, TransactionListener

public abstract class AbstractEdgeListener
extends Object
implements EdgeListener
An abstract adapter class for receiving edge events. The methods in this class are empty. This class exists as convenience for creating listener objects.

Extend this class to create a EdgeEvent listener and override the methods for the events of interest. (If you implement the EdgeListener interface, you have to define all of the methods in it. This abstract class defines null methods for them all, so you can only have to define methods for events you care about.)

Create a listener object using the extended class and then register it with a component using the component's addEdgeEventListener method. When the structure of the graph is changed (e.g.: an edge is added, reversed, an edge's source or target node changes, or an edge is removed) or a transaction of graph structure changes is started or finished, the relevant method in the listener object is invoked and the EdgeEvent is passed to it.

Version:
$Revision: 1.4 $
See Also:
ListenerManager, EdgeEvent
  • Constructor Details

    • AbstractEdgeListener

      public AbstractEdgeListener()
  • Method Details

    • postDirectedChanged

      public void postDirectedChanged​(EdgeEvent e)
      Called after the edge was set directed or undirected.
      Specified by:
      postDirectedChanged in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • postEdgeReversed

      public void postEdgeReversed​(EdgeEvent e)
      Called after the edge has been reversed.
      Specified by:
      postEdgeReversed in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • postSourceNodeChanged

      public void postSourceNodeChanged​(EdgeEvent e)
      Called after the source node of an edge has changed.
      Specified by:
      postSourceNodeChanged in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • postTargetNodeChanged

      public void postTargetNodeChanged​(EdgeEvent e)
      Called after the target node of an edge has changed.
      Specified by:
      postTargetNodeChanged in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • preDirectedChanged

      public void preDirectedChanged​(EdgeEvent e)
      Called before the edge is set directed or undirected.
      Specified by:
      preDirectedChanged in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • preEdgeReversed

      public void preEdgeReversed​(EdgeEvent e)
      Called before the edge is going to be reversed.
      Specified by:
      preEdgeReversed in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • preSourceNodeChanged

      public void preSourceNodeChanged​(EdgeEvent e)
      Called before a change of the source node of an edge takes place.
      Specified by:
      preSourceNodeChanged in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • preTargetNodeChanged

      public void preTargetNodeChanged​(EdgeEvent e)
      Called before a change of the target node of an edge takes place.
      Specified by:
      preTargetNodeChanged in interface EdgeListener
      Parameters:
      e - the EdgeEvent detailing the changes.
    • transactionFinished

      public void transactionFinished​(TransactionEvent e)
      Called after a transaction has been finished.
      Parameters:
      e - gives details about the transaction.
    • transactionStarted

      public void transactionStarted​(TransactionEvent e)
      Called after a transaction has been started.
      Specified by:
      transactionStarted in interface TransactionListener
      Parameters:
      e - gives details about the transaction.