i3.dragos.gm.core.event
Class EdgeConnectionEvent

java.lang.Object
  extended by java.util.EventObject
      extended by i3.dragos.core.services.events.DragosEvent
          extended by i3.dragos.gm.core.event.DataEvent
              extended by i3.dragos.gm.core.event.GraphEntityEvent
                  extended by i3.dragos.gm.core.event.EdgeConnectionEvent
All Implemented Interfaces:
java.io.Serializable

public class EdgeConnectionEvent
extends GraphEntityEvent

An EdgeConnectionEvent is triggered when an edge is disconnected from an entity and / or connected to a new entity.

A note about undirected edges: Although no difference is made between the source and the target, these terms and corresponding fields are still used internally. A source or target change for an undirected edge thus only means that the connection stored in that field has changed.

Author:
Thorsten Hermes <thermes@i3.informatik.rwth-aachen.de>
See Also:
Serialized Form

Field Summary
static int SOURCE_CHANGED
          Event type constant: Identifies a change of the source entity.
static int TARGET_CHANGED
          Event type constant: Identifies a change of the target entity.
 
Fields inherited from class i3.dragos.gm.core.event.GraphEntityEvent
CREATE, DESTROY
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
EdgeConnectionEvent(Edge entity, int eventType, GraphEntity oldConnection, GraphEntity newConnection)
          Constructs a new event.
 
Method Summary
 DataChangeSet getAffectedElements()
          Returns a DataChangeSet of elements affected by this event.
 GraphEntity getNewConnection()
          Returns the newly connected entity (may be null).
 GraphEntity getOldConnection()
          Returns the previously connected entity (may be null).
 java.lang.String toString()
          
 
Methods inherited from class i3.dragos.gm.core.event.GraphEntityEvent
getGraphEntity
 
Methods inherited from class i3.dragos.gm.core.event.DataEvent
getDataSourceURL
 
Methods inherited from class i3.dragos.core.services.events.DragosEvent
getEventClass, getEventType
 
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

SOURCE_CHANGED

public static final int SOURCE_CHANGED
Event type constant: Identifies a change of the source entity.

See Also:
Constant Field Values

TARGET_CHANGED

public static final int TARGET_CHANGED
Event type constant: Identifies a change of the target entity.

See Also:
Constant Field Values
Constructor Detail

EdgeConnectionEvent

public EdgeConnectionEvent(Edge entity,
                           int eventType,
                           GraphEntity oldConnection,
                           GraphEntity newConnection)
Constructs a new event.

Parameters:
entity - The graph entity.
eventType - The type of event.
oldConnection - The previously connected entity (may be null).
newConnection - The newly connected entity (may be null).
Method Detail

getOldConnection

public GraphEntity getOldConnection()
Returns the previously connected entity (may be null).

Returns:
the previously connected entity (may be null).

getNewConnection

public GraphEntity getNewConnection()
Returns the newly connected entity (may be null).

Returns:
the newly connected entity (may be null).

getAffectedElements

public DataChangeSet getAffectedElements()
Returns a DataChangeSet of elements affected by this event.

This method is mainly used by the EventManager to determine which graph entities / graph entity classes need to be marked "dirty".

This list should only contain elements directly affected by the event. Any indirectly affected elements (subclasses, instances...) can be determined later automatically.

The default implementation in DataEvent returns a DataChangeSet that just contains the source of the event.

This implementation returns the edge as well as the old and new source/target (if they are not null).

Overrides:
getAffectedElements in class DataEvent
Returns:
a DataChangeSet of elements affected by this event (may be empty, but never null).

toString

public java.lang.String toString()

Overrides:
toString in class GraphEntityEvent


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.