org.graffiti.event
Class GraphEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.graffiti.event.AbstractEvent
          extended by org.graffiti.event.GraphEvent
All Implemented Interfaces:
Serializable

public class GraphEvent
extends AbstractEvent

Contains a graph event. A GraphEvent object is passed to every GraphListener or AbstractGraphListener object which is registered to receive the "interesting" graph events using the component's addGraphListener method. (AbstractGraphListener objects implement the GraphListener interface.) Each such listener object gets a GraphEvent containing the graph event.

Version:
$Revision: 5767 $
See Also:
GraphListener, AbstractGraphListener, Serialized Form

Constructor Summary
GraphEvent(Edge edge)
          Constructs a graph event object with the specified source component.
GraphEvent(Graph graph)
          Constructs a graph event object with the specified source component.
GraphEvent(Node node)
          Constructs a graph event object with the specified source component.
GraphEvent(Node node, Node secondNode)
          Constructs a graph event object with the graph of the first node as source and saves the two given nodes.
 
Method Summary
 Edge getEdge()
          Returns the edge that originates this event, e.g.: the edge that has been added.
 Graph getGraph()
          Returns the graph that has been changed.
 Node getNode()
          Returns the node that is concerned with that event, e.g.: the node that has been / is to be removed.
 Node getSecondNode()
          Returns the node that is concerned with that event, e.g.: the node that has been / is to be removed.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphEvent

public GraphEvent(Graph graph)
Constructs a graph event object with the specified source component.

Parameters:
graph - the graph that originated the event.

GraphEvent

public GraphEvent(Edge edge)
Constructs a graph event object with the specified source component.

Parameters:
edge - the edge that originated the event.

GraphEvent

public GraphEvent(Node node)
Constructs a graph event object with the specified source component.

Parameters:
node - the node that originated the event.

GraphEvent

public GraphEvent(Node node,
                  Node secondNode)
Constructs a graph event object with the graph of the first node as source and saves the two given nodes.

Parameters:
node - the node that originated the event.
secondNode - the second node that originated the event.
Method Detail

getEdge

public Edge getEdge()
Returns the edge that originates this event, e.g.: the edge that has been added. Might return null if no edge is concerned.

Returns:
the edge that is concerned with the event

getGraph

public Graph getGraph()
Returns the graph that has been changed.

Returns:
the graph that has been changed by this event.

getNode

public Node getNode()
Returns the node that is concerned with that event, e.g.: the node that has been / is to be removed. Might return null if no node is concerned.

Returns:
the edge that is concerned with the event.

getSecondNode

public Node getSecondNode()
Returns the node that is concerned with that event, e.g.: the node that has been / is to be removed. Might return null if no node is concerned.

Returns:
the edge that is concerned with the event.


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