Package org.graffiti.event
Class AbstractGraphListener
java.lang.Object
org.graffiti.event.AbstractGraphListener
- All Implemented Interfaces:
EventListener,GraphListener,TransactionListener
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: 1.4 $
- See Also:
ListenerManager,GraphEvent
-
Constructor Summary
Constructors Constructor Description AbstractGraphListener() -
Method Summary
Modifier and Type Method Description voidpostEdgeAdded(GraphEvent e)Called after an edge has been added to the graph.voidpostEdgeRemoved(GraphEvent e)Called after an edge has been removed from the graph.voidpostGraphCleared(GraphEvent e)Called after methodclear()has been called on a graph.voidpostNodeAdded(GraphEvent e)Called after an edge has been added to the graph.voidpostNodeRemoved(GraphEvent e)Called after a node has been removed from the graph.voidpreEdgeAdded(GraphEvent e)Called just before an edge is added to the graph.voidpreEdgeRemoved(GraphEvent e)Called just before an edge is removed from the graph.voidpreGraphCleared(GraphEvent e)Called before methodclear()is called on a graph.voidpreNodeAdded(GraphEvent e)Called just before a node is added to the graph.voidpreNodeRemoved(GraphEvent e)Called just before a node is removed from the graph.voidtransactionFinished(TransactionEvent e)Called after a transaction has been finished.voidtransactionStarted(TransactionEvent e)Called before a transaction has been started.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graffiti.event.TransactionListener
transactionFinished
-
Constructor Details
-
AbstractGraphListener
public AbstractGraphListener()
-
-
Method Details
-
postEdgeAdded
Called after an edge has been added to the graph.- Specified by:
postEdgeAddedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
postEdgeRemoved
Called after an edge has been removed from the graph.- Specified by:
postEdgeRemovedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
postGraphCleared
Called after methodclear()has been called on a graph. No other events (like remove events) are generated.- Specified by:
postGraphClearedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
postNodeAdded
Called after an edge has been added to the graph.- Specified by:
postNodeAddedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
postNodeRemoved
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:
postNodeRemovedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
preEdgeAdded
Called just before an edge is added to the graph.- Specified by:
preEdgeAddedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
preEdgeRemoved
Called just before an edge is removed from the graph.- Specified by:
preEdgeRemovedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
preGraphCleared
Called before methodclear()is called on a graph. No other events (like remove events) are generated.- Specified by:
preGraphClearedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
preNodeAdded
Called just before a node is added to the graph.- Specified by:
preNodeAddedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
preNodeRemoved
Called just before a node is removed from the graph. This method is called before the incident edges are deleted.- Specified by:
preNodeRemovedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
transactionFinished
Called after a transaction has been finished.- Parameters:
e- gives details about the transaction.
-
transactionStarted
Called before a transaction has been started.- Specified by:
transactionStartedin interfaceTransactionListener- Parameters:
e- gives details about the transaction.
-