com.tensegrity.graph.event
Class VetoableGraphEventMediator

java.lang.Object
  extended bycom.tensegrity.graph.event.VetoableGraphEventMediator
All Implemented Interfaces:
EventListenerTag, VetoableGraphListener

public class VetoableGraphEventMediator
extends java.lang.Object
implements VetoableGraphListener

The VetoableGraphEventMediator facilitates to gain access to all vetoable GraphEvents.
The VetoableGraphEventMediator is allways an instance variable of a Graph and hasn't to be implemented nor registered to a GraphObject instance. This is a mandatory commandment!
An implementation of a Graph allways comes with its own VetoableGraphEventMediator implementation and is a major part of the architecture.

To be informed about all occuring vetoable events an object has to implement the GraphEventMediatorListener interface and then registered at a specific Graph as VetoableGraphEventMediatorListener.

Version:
$Id: VetoableGraphEventMediator.java,v 1.7 2005/04/04 07:15:48 MichaelKegel Exp $
Author:
MichaelKegel

Constructor Summary
VetoableGraphEventMediator()
          Constructor for VetoableGraphEventMediator.
 
Method Summary
 void addMediatorListener(VetoableGraphEventMediatorListener listener)
          Adds the VetoableGraphEventMediatorListener given by listener to the VetoableGraphEventMediator instance such that the listener will be notified about every event that occurs.
 java.util.List getListeners()
          Returns a List of the VetoableGraphEventMediatorListeners currently registered.
 void removeMediatorListener(VetoableGraphEventMediatorListener listener)
          Removes the VetoableGraphEventMediatorListener given by listener from the VetoableGraphEventMediator instance such that the listener will no longer be notified about occuring events.
 void vetoableEdgePreAdd(GraphEvent graphevent)
          This mehtod is called when an Edge is about to be added to a Graph.
 void vetoableEdgePreRemove(GraphEvent graphevent)
          This method is called when an Edge is about to be removed from a Graph.
 void vetoableEdgePreSplit(GraphEvent graphevent)
          This method is called when an Edge is about to be split by a node.
 void vetoableNodePreAdd(GraphEvent graphevent)
          This method is called when a Node is about to be added to a Graph.
 void vetoableNodePreDeleteEdgeCascade(GraphEvent graphevent)
          This method is called when an Node is about to delete, which will is connected by two edges that will be automatically merged into a single edge.
 void vetoableNodePreRemove(GraphEvent graphevent)
          This method is called when a Node is about to be removed from a Graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VetoableGraphEventMediator

public VetoableGraphEventMediator()
Constructor for VetoableGraphEventMediator.

Method Detail

addMediatorListener

public void addMediatorListener(VetoableGraphEventMediatorListener listener)
Adds the VetoableGraphEventMediatorListener given by listener to the VetoableGraphEventMediator instance such that the listener will be notified about every event that occurs.

Parameters:
listener - the VetoableGraphEventMediatorListener to add

removeMediatorListener

public void removeMediatorListener(VetoableGraphEventMediatorListener listener)
Removes the VetoableGraphEventMediatorListener given by listener from the VetoableGraphEventMediator instance such that the listener will no longer be notified about occuring events.

Parameters:
listener - the VetoableGraphEventMediatorListener to remove

getListeners

public java.util.List getListeners()
Returns a List of the VetoableGraphEventMediatorListeners currently registered.

Returns:
List the list of the listeners currently registered

vetoableNodePreAdd

public void vetoableNodePreAdd(GraphEvent graphevent)
                        throws GraphEventVetoException
Description copied from interface: VetoableGraphListener
This method is called when a Node is about to be added to a Graph.
If the implementor throws a GraphEventVetoException the event will be veto'd and the corresponding action will not be completed.

Specified by:
vetoableNodePreAdd in interface VetoableGraphListener
Parameters:
graphevent - the GraphEvent structure carrying event information.
Throws:
GraphEventVetoException - that indicates the GraphEvent is not desired.

vetoableNodePreRemove

public void vetoableNodePreRemove(GraphEvent graphevent)
                           throws GraphEventVetoException
Description copied from interface: VetoableGraphListener
This method is called when a Node is about to be removed from a Graph.
If the implementor throws a GraphEventVetoException the event will be veto'd and the corresponding action will not be completed.

Specified by:
vetoableNodePreRemove in interface VetoableGraphListener
Parameters:
graphevent - the GraphEvent structure carrying event information.
Throws:
GraphEventVetoException - that indicates the GraphEvent is not desired.

vetoableEdgePreAdd

public void vetoableEdgePreAdd(GraphEvent graphevent)
                        throws GraphEventVetoException
Description copied from interface: VetoableGraphListener
This mehtod is called when an Edge is about to be added to a Graph.
If the implementor throws a GraphEventVetoException the event will be veto'd and the corresponding action will not be completed.

Specified by:
vetoableEdgePreAdd in interface VetoableGraphListener
Parameters:
graphevent - the GraphEvent structure carrying event information.
Throws:
GraphEventVetoException - that indicates the GraphEvent is not desired.

vetoableEdgePreRemove

public void vetoableEdgePreRemove(GraphEvent graphevent)
                           throws GraphEventVetoException
Description copied from interface: VetoableGraphListener
This method is called when an Edge is about to be removed from a Graph.
If the implementor throws a GraphEventVetoException the event will be veto'd and the corresponding action will not be completed.

Specified by:
vetoableEdgePreRemove in interface VetoableGraphListener
Parameters:
graphevent - the GraphEvent structure carrying event information.
Throws:
GraphEventVetoException - that indicates the GraphEvent is not desired.

vetoableEdgePreSplit

public void vetoableEdgePreSplit(GraphEvent graphevent)
                          throws GraphEventVetoException
Description copied from interface: VetoableGraphListener
This method is called when an Edge is about to be split by a node. If the implementor throws a GraphEventVetoException the event will be veto'd and the corresponding action will not be completed.

Specified by:
vetoableEdgePreSplit in interface VetoableGraphListener
Parameters:
graphevent - the GraphEvent structure carrying event information.
Throws:
GraphEventVetoException - that indicates the GraphEvent is not desired.

vetoableNodePreDeleteEdgeCascade

public void vetoableNodePreDeleteEdgeCascade(GraphEvent graphevent)
                                      throws GraphEventVetoException
Description copied from interface: VetoableGraphListener
This method is called when an Node is about to delete, which will is connected by two edges that will be automatically merged into a single edge. If the implementor throws a GraphEventVetoException the event will be veto'd and the corresponding action will not be completed.

Specified by:
vetoableNodePreDeleteEdgeCascade in interface VetoableGraphListener
Parameters:
graphevent - the GraphEvent structure carrying event information.
Throws:
GraphEventVetoException - that indicates the GraphEvent is not desired.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.