Class 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: 1.6 $
See Also:
GraphListener, AbstractGraphListener, Serialized Form
  • Constructor Details

    • 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 Details

    • 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.
    • getAttributeable

      public Attributable getAttributeable()