com.tensegrity.graph.event
Class VisualGraphEventMediator

java.lang.Object
  extended bycom.tensegrity.graph.event.VisualGraphEventMediator
All Implemented Interfaces:
EventListenerTag, VisualEdgeListener, VisualGraphListener, VisualNodeListener

public class VisualGraphEventMediator
extends java.lang.Object
implements VisualGraphListener, VisualNodeListener, VisualEdgeListener

The VisualGraphEventMediator facilitates to gain access to all VisualGraph events, VisualNode events and VisualEdge events.

To be informed about all occurring events an object has to implement the VisualGraphEventMediatorListener interface and then registered at a VisualGraphView instance as event mediator listener.

The VisualGraphEventMediator is always an instance variable of a VisualGraphView and hasn't to be implemented nor registered to any instance of a VisualGraphObject. This is a mandatory commandment!
An implementation of a VisualGraphView always comes with its own VisualGraphEventMediator implementation, which is a major part of the architecture.

Version:
$Id: VisualGraphEventMediator.java,v 1.12 2006/03/23 11:15:10 MichaelKegel Exp $
Author:
MichaelKegel
See Also:
VisualGraphView, VisualGraphEventMediatorListener

Constructor Summary
VisualGraphEventMediator()
          Constructor for VisualGraphEventMediator.
 
Method Summary
 void addMediatorListener(VisualGraphEventMediatorListener listener)
          Adds the VisualGraphEventMediatorListener given by listener to the VisualGraphEventMediator instance such that the listener will be notified about every event that occurs.
 java.util.List getListeners()
          Returns a List of the VisualGraphEventMediatorListeners currently registered.
 void isolatedVisualEdgeAdded(VisualEdgeEvent event)
          This method is invoked when an isolated VisualEdge is added.
 void isolatedVisualEdgeAdded(VisualGraphEvent visualgraphevent)
          An isolated VisualEdge was added to the VisualGraph.
 void isolatedVisualEdgeRemoved(VisualEdgeEvent event)
          This method is invoked when an isolated VisualEdge is removed.
 void isolatedVisualEdgeRemoved(VisualGraphEvent visualgraphevent)
          An isolated VisualEdge was removed from the VisualGraph.
 void layout(VisualGraphEvent visualgraphevent)
          The structure of the VisualGraph has changed by an action on the graph, so that the current layout of the graph has to be applied.
 void removeMediatorListener(VisualGraphEventMediatorListener listener)
          Removes the VisualGraphEventMediatorListener given by listener from the VisualGraphEventMediator instance such that the listener will no longer be notified about occuring events.
 void visualEdgeAdded(VisualEdgeEvent event)
          This method is invoked when a VisualEdge is added.
 void visualEdgeAdded(VisualGraphEvent visualgraphevent)
          A VisualEdge was added to the VisualGraph.
 void visualEdgeAttachRejected(VisualGraphEvent visualgraphevent)
          An attachment of a VisualEdge was rejected by the graph.
 void visualEdgeRemoved(VisualEdgeEvent event)
          This method is invoked when a VisualEdge is removed.
 void visualEdgeRemoved(VisualGraphEvent visualgraphevent)
          A VisualEdge was removed from the VisualGraph.
 void visualEdgeSplit(VisualGraphEvent visualgraphevent)
          An edge-split was performed.
 void visualNodeAdded(VisualGraphEvent visualgraphevent)
          A VisualNode was added to the VisualGraph.
 void visualNodeAdded(VisualNodeEvent event)
          This method is invoked when a VisualNode is added.
 void visualNodeDeleteEdgeCascade(VisualGraphEvent visualgraphevent)
          An edge-cascade was performed.
 void visualNodeRemoved(VisualGraphEvent visualgraphevent)
          A VisualNode was added to the VisualGraph.
 void visualNodeRemoved(VisualNodeEvent event)
          This method is invoked when a VisualNode is removed.
 void visualPortAdded(VisualNodeEvent event)
          This method is invoked on the listener if a VisualPort is added to a VisualNode.
 void visualPortRemoved(VisualNodeEvent event)
          This method is invoked on the listener if a VisualPort is removed from a VisualNode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisualGraphEventMediator

public VisualGraphEventMediator()
Constructor for VisualGraphEventMediator.

Method Detail

addMediatorListener

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

Parameters:
listener - the VisualGraphEventMediatorListener to add

removeMediatorListener

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

Parameters:
listener - the VisualGraphEventMediatorListener to remove

getListeners

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

Returns:
List the list of the listeners currently registered

visualNodeAdded

public void visualNodeAdded(VisualGraphEvent visualgraphevent)
Description copied from interface: VisualGraphListener
A VisualNode was added to the VisualGraph.

Specified by:
visualNodeAdded in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.

visualNodeRemoved

public void visualNodeRemoved(VisualGraphEvent visualgraphevent)
Description copied from interface: VisualGraphListener
A VisualNode was added to the VisualGraph.

Specified by:
visualNodeRemoved in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.

visualEdgeAdded

public void visualEdgeAdded(VisualGraphEvent visualgraphevent)
Description copied from interface: VisualGraphListener
A VisualEdge was added to the VisualGraph.

Specified by:
visualEdgeAdded in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.

visualEdgeRemoved

public void visualEdgeRemoved(VisualGraphEvent visualgraphevent)
Description copied from interface: VisualGraphListener
A VisualEdge was removed from the VisualGraph.

Specified by:
visualEdgeRemoved in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.

isolatedVisualEdgeAdded

public void isolatedVisualEdgeAdded(VisualGraphEvent visualgraphevent)
Description copied from interface: VisualGraphListener
An isolated VisualEdge was added to the VisualGraph.

Specified by:
isolatedVisualEdgeAdded in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.

isolatedVisualEdgeRemoved

public void isolatedVisualEdgeRemoved(VisualGraphEvent visualgraphevent)
Description copied from interface: VisualGraphListener
An isolated VisualEdge was removed from the VisualGraph.

Specified by:
isolatedVisualEdgeRemoved in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.

visualEdgeAttachRejected

public void visualEdgeAttachRejected(VisualGraphEvent visualgraphevent)
Description copied from interface: VisualGraphListener
An attachment of a VisualEdge was rejected by the graph. This event is thrown to indicate that an edge could not be added if the library chooses to do so in certain contexts. If it however not thrown in all cases when a VisualEdge cannot be added. If for example an already added VisualEdge is added, this event is not thrown.

Specified by:
visualEdgeAttachRejected in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.

visualEdgeSplit

public void visualEdgeSplit(VisualGraphEvent visualgraphevent)
Description copied from interface: VisualGraphListener
An edge-split was performed.

Specified by:
visualEdgeSplit in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.

visualNodeDeleteEdgeCascade

public void visualNodeDeleteEdgeCascade(VisualGraphEvent visualgraphevent)
Description copied from interface: VisualGraphListener
An edge-cascade was performed.

Specified by:
visualNodeDeleteEdgeCascade in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.

layout

public void layout(VisualGraphEvent visualgraphevent)
Description copied from interface: VisualGraphListener
The structure of the VisualGraph has changed by an action on the graph, so that the current layout of the graph has to be applied. Note: programmatically changes like node insertion might not invoke this callback

Specified by:
layout in interface VisualGraphListener
Parameters:
visualgraphevent - the VisualGraphEvent structure that contains the event information.

visualNodeAdded

public void visualNodeAdded(VisualNodeEvent event)
Description copied from interface: VisualNodeListener
This method is invoked when a VisualNode is added.

Specified by:
visualNodeAdded in interface VisualNodeListener
Parameters:
event - the event structure carrying additional information.

visualNodeRemoved

public void visualNodeRemoved(VisualNodeEvent event)
Description copied from interface: VisualNodeListener
This method is invoked when a VisualNode is removed.

Specified by:
visualNodeRemoved in interface VisualNodeListener
Parameters:
event - the event structure carrying additional information.

visualPortAdded

public void visualPortAdded(VisualNodeEvent event)
Description copied from interface: VisualNodeListener
This method is invoked on the listener if a VisualPort is added to a VisualNode.

Specified by:
visualPortAdded in interface VisualNodeListener

visualPortRemoved

public void visualPortRemoved(VisualNodeEvent event)
Description copied from interface: VisualNodeListener
This method is invoked on the listener if a VisualPort is removed from a VisualNode.

Specified by:
visualPortRemoved in interface VisualNodeListener
Parameters:
event - the structure that holds details about the event.

visualEdgeAdded

public void visualEdgeAdded(VisualEdgeEvent event)
Description copied from interface: VisualEdgeListener
This method is invoked when a VisualEdge is added.

Specified by:
visualEdgeAdded in interface VisualEdgeListener
Parameters:
event - the event structure carrying additional information.

visualEdgeRemoved

public void visualEdgeRemoved(VisualEdgeEvent event)
Description copied from interface: VisualEdgeListener
This method is invoked when a VisualEdge is removed.

Specified by:
visualEdgeRemoved in interface VisualEdgeListener
Parameters:
event - the event structure carrying additional information.

isolatedVisualEdgeAdded

public void isolatedVisualEdgeAdded(VisualEdgeEvent event)
Description copied from interface: VisualEdgeListener
This method is invoked when an isolated VisualEdge is added.

Specified by:
isolatedVisualEdgeAdded in interface VisualEdgeListener
Parameters:
event - the event structure carrying additional information.

isolatedVisualEdgeRemoved

public void isolatedVisualEdgeRemoved(VisualEdgeEvent event)
Description copied from interface: VisualEdgeListener
This method is invoked when an isolated VisualEdge is removed.

Specified by:
isolatedVisualEdgeRemoved in interface VisualEdgeListener
Parameters:
event - the event structure carrying additional information.


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