org.graffiti.event
Class AbstractGraphListener

java.lang.Object
  extended by org.graffiti.event.AbstractGraphListener
All Implemented Interfaces:
EventListener, GraphListener, TransactionListener
Direct Known Subclasses:
SelectionModel

public abstract class AbstractGraphListener
extends Object
implements GraphListener

An abstract adapter class for receiving graph events. The methods in this class are empty. This class exists as convenience for creating listener objects.

Extend this class to create a GraphEvent listener and override the methods for the events of interest. (If you implement the GraphListener 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 addGraphEventListener method. When the structure of the graph object is changed or a transaction of graph changes is started or finished, the relevant method in the listener object is invoked and the GraphEvent is passed to it.

Version:
$Revision: 5767 $
See Also:
ListenerManager, GraphEvent

Constructor Summary
AbstractGraphListener()
           
 
Method Summary
 void postEdgeAdded(GraphEvent e)
          Called after an edge has been added to the graph.
 void postEdgeRemoved(GraphEvent e)
          Called after an edge has been removed from the graph.
 void postGraphCleared(GraphEvent e)
          Called after method clear() has been called on a graph.
 void postNodeAdded(GraphEvent e)
          Called after an edge has been added to the graph.
 void postNodeRemoved(GraphEvent e)
          Called after a node has been removed from the graph.
 void preEdgeAdded(GraphEvent e)
          Called just before an edge is added to the graph.
 void preEdgeRemoved(GraphEvent e)
          Called just before an edge is removed from the graph.
 void preGraphCleared(GraphEvent e)
          Called before method clear() is called on a graph.
 void preNodeAdded(GraphEvent e)
          Called just before a node is added to the graph.
 void preNodeRemoved(GraphEvent e)
          Called just before a node is removed from the graph.
 void transactionFinished(TransactionEvent e)
          Called after a transaction has been finished.
 void transactionStarted(TransactionEvent e)
          Called before a transaction has been started.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractGraphListener

public AbstractGraphListener()
Method Detail

postEdgeAdded

public void postEdgeAdded(GraphEvent e)
Called after an edge has been added to the graph.

Specified by:
postEdgeAdded in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

postEdgeRemoved

public void postEdgeRemoved(GraphEvent e)
Called after an edge has been removed from the graph.

Specified by:
postEdgeRemoved in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

postGraphCleared

public void postGraphCleared(GraphEvent e)
Called after method clear() has been called on a graph. No other events (like remove events) are generated.

Specified by:
postGraphCleared in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

postNodeAdded

public void postNodeAdded(GraphEvent e)
Called after an edge has been added to the graph.

Specified by:
postNodeAdded in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

postNodeRemoved

public void postNodeRemoved(GraphEvent e)
Called after a node has been removed from the graph. All edges incident to this node have already been removed (preEdgeRemoved and postEdgeRemoved have been called).

Specified by:
postNodeRemoved in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

preEdgeAdded

public void preEdgeAdded(GraphEvent e)
Called just before an edge is added to the graph.

Specified by:
preEdgeAdded in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

preEdgeRemoved

public void preEdgeRemoved(GraphEvent e)
Called just before an edge is removed from the graph.

Specified by:
preEdgeRemoved in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

preGraphCleared

public void preGraphCleared(GraphEvent e)
Called before method clear() is called on a graph. No other events (like remove events) are generated.

Specified by:
preGraphCleared in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

preNodeAdded

public void preNodeAdded(GraphEvent e)
Called just before a node is added to the graph.

Specified by:
preNodeAdded in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

preNodeRemoved

public void preNodeRemoved(GraphEvent e)
Called just before a node is removed from the graph. This method is called before the incident edges are deleted.

Specified by:
preNodeRemoved in interface GraphListener
Parameters:
e - the GraphEvent detailing the changes.

transactionFinished

public void transactionFinished(TransactionEvent e)
Called after a transaction has been finished.

Specified by:
transactionFinished in interface TransactionListener
Parameters:
e - gives details about the transaction.

transactionStarted

public void transactionStarted(TransactionEvent e)
Called before a transaction has been started.

Specified by:
transactionStarted in interface TransactionListener
Parameters:
e - gives details about the transaction.


Generated at 2012-05-30 11:00:14 PM CEST