y.base
Class GraphEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--y.base.GraphEvent
All Implemented Interfaces:
Serializable

public class GraphEvent
extends EventObject

An event which indicates that a graph structure change occured. This low-level event is generated by a graph when its structure changes. The event is passed to every every GraphListener object that registered to receive such events using the graph's addGraphListener method.

The object that implements the GraphListener interface gets this GraphEvent when the event occurs.

Each GraphEvent has a type that signals what kind of change occured in the graph and a data object that is the object (either node or edge) that was involved in the structural change of the graph, e.g. the node that has been created or the edge that has been reversed.

See Also:
Serialized Form

Field Summary
static byte EDGE_CREATION
          Type constant that identifies an event that gets fired immediatelly after an edge has been created.
static byte EDGE_REINSERTION
          Type constant that identifies an event that gets fired immediatelly after an edge has been reinserted in the graph.
static byte NODE_CREATION
          Type constant that identifies an event that gets fired immediatelly after a node has been created.
static byte NODE_REINSERTION
          Type constant that identifies an event that gets fired immediatelly after a node has been reinserted in the graph.
static byte POST_EDGE_CHANGE
          Type constant that identifies an event that gets fired immediatelly before the endpoints of an edge will be changed.
static byte POST_EDGE_REMOVAL
          Type constant that identifies an event that gets fired immediatelly after an edge will be removed from the graph.
static byte POST_EVENT
          Type constant that signals the end of a some logically coherent event sequence.
static byte POST_NODE_REMOVAL
          Type constant that identifies an event that gets fired immediatelly after a node has been removed from the graph.
static byte PRE_EDGE_CHANGE
          Type constant that identifies an event that gets fired immediatelly before the endpoints of an edge will be changed.
static byte PRE_EDGE_REMOVAL
          Type constant that identifies an event that gets fired immediatelly before an edge will be removed from the graph.
static byte PRE_EVENT
          Type constant that signals the start of a some logically coherent event sequence.
static byte PRE_NODE_REMOVAL
          Type constant that identifies an event that gets fired immediatelly before a node will be removed from the graph.
static byte SUBGRAPH_INSERTION
          Type constant that identifies an event that gets fired after a subgraph of another graph has been moved to this graph.
static byte SUBGRAPH_REMOVAL
          Type constant that identifies an event that gets fired after a subgraph of a graph has been moved to another graph.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
GraphEvent(Graph source, byte type, Object data)
          Creates a new Instance of GraphEvent with given type and data
 
Method Summary
 Object getData()
          Returns the data object associated with this graph event.
 Graph getGraph()
          Returns the graph that is the emitter of this event.
 byte getType()
          Returns the type of this GraphEvent.
 String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NODE_CREATION

public static final byte NODE_CREATION
Type constant that identifies an event that gets fired immediatelly after a node has been created. The data of the event is the newly created node.

See Also:
Constant Field Values

EDGE_CREATION

public static final byte EDGE_CREATION
Type constant that identifies an event that gets fired immediatelly after an edge has been created. The data of the event is the newly created edge

See Also:
Constant Field Values

PRE_NODE_REMOVAL

public static final byte PRE_NODE_REMOVAL
Type constant that identifies an event that gets fired immediatelly before a node will be removed from the graph. The data of the event is the to be removed node.

See Also:
Constant Field Values

POST_NODE_REMOVAL

public static final byte POST_NODE_REMOVAL
Type constant that identifies an event that gets fired immediatelly after a node has been removed from the graph. The data of the event is the removed node.

See Also:
Constant Field Values

PRE_EDGE_REMOVAL

public static final byte PRE_EDGE_REMOVAL
Type constant that identifies an event that gets fired immediatelly before an edge will be removed from the graph. The data of the event is the to be removed edge.

See Also:
Constant Field Values

POST_EDGE_REMOVAL

public static final byte POST_EDGE_REMOVAL
Type constant that identifies an event that gets fired immediatelly after an edge will be removed from the graph. The data of the event is the removed edge.

See Also:
Constant Field Values

NODE_REINSERTION

public static final byte NODE_REINSERTION
Type constant that identifies an event that gets fired immediatelly after a node has been reinserted in the graph. The data of the event is the to be reinserted node.

See Also:
Constant Field Values

EDGE_REINSERTION

public static final byte EDGE_REINSERTION
Type constant that identifies an event that gets fired immediatelly after an edge has been reinserted in the graph. The data of the event is the to be reinserted edge

See Also:
Constant Field Values

PRE_EDGE_CHANGE

public static final byte PRE_EDGE_CHANGE
Type constant that identifies an event that gets fired immediatelly before the endpoints of an edge will be changed. The data of the event is the to be redefined edge

See Also:
Constant Field Values

POST_EDGE_CHANGE

public static final byte POST_EDGE_CHANGE
Type constant that identifies an event that gets fired immediatelly before the endpoints of an edge will be changed. The data of the event is the redefined edge.

See Also:
Constant Field Values

SUBGRAPH_INSERTION

public static final byte SUBGRAPH_INSERTION
Type constant that identifies an event that gets fired after a subgraph of another graph has been moved to this graph. The data of the event is a NodeList containing the nodes that induce the moved subgraph. At the time the event gets fired these nodes are already part of this graph. This event gets fired just after the GraphEvent.SUBGRAPH_REMOVAL event got fired on the source graph.

See Also:
Constant Field Values

SUBGRAPH_REMOVAL

public static final byte SUBGRAPH_REMOVAL
Type constant that identifies an event that gets fired after a subgraph of a graph has been moved to another graph. The data of the event is a NodeList containing the nodes that induce the moved subgraph. At the time the event gets fired these nodes are already part of the target graph. This event gets fired just before the GraphEvent.SUBGRAPH_INSERTION event gets fired on the target graph.

See Also:
Constant Field Values

PRE_EVENT

public static final byte PRE_EVENT
Type constant that signals the start of a some logically coherent event sequence. If specified the data of this event is its ID.

See Also:
Constant Field Values

POST_EVENT

public static final byte POST_EVENT
Type constant that signals the end of a some logically coherent event sequence. If specified the data of this event is its ID.

See Also:
Constant Field Values
Constructor Detail

GraphEvent

public GraphEvent(Graph source,
                  byte type,
                  Object data)
Creates a new Instance of GraphEvent with given type and data

Method Detail

getType

public byte getType()
Returns the type of this GraphEvent. It can be either of the type constants defined in this class.


getData

public Object getData()
Returns the data object associated with this graph event.


getGraph

public Graph getGraph()
Returns the graph that is the emitter of this event.


toString

public String toString()
Overrides:
toString in class EventObject

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003