com.tensegrity.graph.event
Class VisualGraphEvent

java.lang.Object
  extended bycom.tensegrity.graph.event.AbstractVisualGraphEvent
      extended bycom.tensegrity.graph.event.VisualGraphEvent
All Implemented Interfaces:
VisualGraphRootEvent

public class VisualGraphEvent
extends com.tensegrity.graph.event.AbstractVisualGraphEvent

A visualgraph event. This class encapsulates event information for both VisualGraphViews and for VisualSubgraphs. It is possible to add a VisualGraphListener or a VisualGraphEventMediator to the two previously mentioned types, which in turn will be invoked when events occur. The information that is associated with a single event is packaged into an instance of this class.

If an instance of this class was triggered by an action inside of a VisualGraphView then a reference to the actual instance can be obtained by invoked the method AbstractVisualGraphEvent.getVisualGraph()

If an instance of this class was triggered by an action inside of a VisualSubgraph then a reference to the actual instance can be obtained by invoked the method AbstractVisualGraphEvent.getVisualSubgraph()

Since the source of the event can be only either one of the two types, one of the two methods will return null and the other one will return the event source.

Version:
$Id: VisualGraphEvent.java,v 1.19 2006/03/23 11:15:10 MichaelKegel Exp $
Author:
Stepan Rutz

Field Summary
static int EDGESPLIT
          Constants that define the different event types.
static int ISOLATED_VISUALEDGE_ADDED
          Constants that define the different event types.
static int ISOLATED_VISUALEDGE_PRE_ADD
          Constants that define the different event types.
static int ISOLATED_VISUALEDGE_PRE_REMOVE
          Constants that define the different event types.
static int ISOLATED_VISUALEDGE_REMOVED
          Constants that define the different event types.
static int LAYOUT
          Constants that define the different event types.
static int VISUALEDGE_ADDED
          Constants that define the different event types.
static int VISUALEDGE_ATTACH_REJECTED
          Constants that define the different event types.
static int VISUALEDGE_PRE_ADD
          Constants that define the different event types.
static int VISUALEDGE_PRE_REMOVE
          Constants that define the different event types.
static int VISUALEDGE_REMOVED
          Constants that define the different event types.
static int VISUALNODE_ADDED
          Constants that define the different event types.
static int VISUALNODE_DELETE_CASCADE
          Constants that define the different event types.
static int VISUALNODE_PRE_ADD
          Constants that define the different event types.
static int VISUALNODE_PRE_REMOVE
          Constants that define the different event types.
static int VISUALNODE_REMOVED
          Constants that define the different event types.
 
Constructor Summary
VisualGraphEvent(int eventid, VisualGraph visualgraph)
          Constructs a new VisualGraphEvent.
VisualGraphEvent(int eventid, VisualGraph visualgraph, VisualEdge visualedge, long visualedgeid)
          Constructs a new VisualGraphEvent.
VisualGraphEvent(int eventid, VisualGraph visualgraph, VisualNode visualnode, long visualnodeid)
          Constructs a new VisualGraphEvent.
VisualGraphEvent(int eventid, VisualGraph visualgraph, VisualSubgraph visualsubgraph, long vnID, VisualNode vn, long veID, VisualEdge ve, VisualGraphObjectContainer veVGOC, VisualEdge veIn, VisualGraphObjectContainer veInVGOC, VisualEdge veOut, VisualGraphObjectContainer veOutVGOC)
           
VisualGraphEvent(int eventid, VisualGraph visualgraph, VisualSubgraph visualsubgraph, VisualNode visualnode, VisualEdge visualedge, long visualnodeid, long visualedgeid, VisualEdge newedge1, VisualEdge newedge2)
          Constructs a new VisualGraphEvent.
VisualGraphEvent(int eventid, VisualSubgraph visualsubgraph)
          Constructs a new VisualGraphEvent.
VisualGraphEvent(int eventid, VisualSubgraph visualsubgraph, VisualEdge visualedge, long visualedgeid)
          Constructs a new VisualGraphEvent.
VisualGraphEvent(int eventid, VisualSubgraph visualsubgraph, VisualNode visualnode, long visualnodeid)
          Constructs a new VisualGraphEvent.
 
Method Summary
 java.lang.String getDescription()
          Returns a textual description for the event.
 int getID()
          Returns the event id of this event.
 VisualEdge getNewSplitEdge1()
          If the event is an edgesplit event, this method will return the first of the two newly introduced edges that replace the original split edge.
 VisualGraphObjectContainer getNewSplitEdge1Container()
           
 VisualEdge getNewSplitEdge2()
          If the event is an edgesplit event, this method will return the second of the two newly introduced edges that replace the original split edge.
 VisualGraphObjectContainer getNewSplitEdge2Container()
           
 VisualEdge getOldEdge1()
          If the event is an nodedelete-edge-cascade-event, this method will return the firstof the two previous edges that were replaced the new cascaded edge.
 VisualGraphObjectContainer getOldEdge1Container()
           
 VisualEdge getOldEdge2()
          If the event is an nodedelete-edge-cascade-event, this method will return the second of the two previous edges that were replaced the new cascaded edge.
 VisualGraphObjectContainer getOldEdge2Container()
           
 VisualEdge getSubjectVisualEdge()
          Returns the subject visualedge for this event.
 VisualGraphObjectContainer getSubjectVisualEdgeContainer()
           
 long getSubjectVisualEdgeID()
          Returns the subject visualedge id for this event.
 VisualNode getSubjectVisualNode()
          Returns the subject visualnode for this event.
 VisualGraphObjectContainer getSubjectVisualNodeContainer()
           
 long getSubjectVisualNodeID()
          Returns the subject visualnode id for this event.
 VisualGraph getVisualGraph()
          Returns the VisualGraph that caused the event.
 VisualSubgraph getVisualSubgraph()
          Returns the VisualSubgraph that caused the event.
static java.lang.String id2string(int id)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VISUALNODE_ADDED

public static final int VISUALNODE_ADDED
Constants that define the different event types.

See Also:
Constant Field Values

VISUALNODE_REMOVED

public static final int VISUALNODE_REMOVED
Constants that define the different event types.

See Also:
Constant Field Values

VISUALEDGE_ADDED

public static final int VISUALEDGE_ADDED
Constants that define the different event types.

See Also:
Constant Field Values

VISUALEDGE_REMOVED

public static final int VISUALEDGE_REMOVED
Constants that define the different event types.

See Also:
Constant Field Values

ISOLATED_VISUALEDGE_ADDED

public static final int ISOLATED_VISUALEDGE_ADDED
Constants that define the different event types.

See Also:
Constant Field Values

ISOLATED_VISUALEDGE_REMOVED

public static final int ISOLATED_VISUALEDGE_REMOVED
Constants that define the different event types.

See Also:
Constant Field Values

VISUALEDGE_ATTACH_REJECTED

public static final int VISUALEDGE_ATTACH_REJECTED
Constants that define the different event types.

See Also:
Constant Field Values

LAYOUT

public static final int LAYOUT
Constants that define the different event types.

See Also:
Constant Field Values

EDGESPLIT

public static final int EDGESPLIT
Constants that define the different event types.

See Also:
Constant Field Values

VISUALNODE_DELETE_CASCADE

public static final int VISUALNODE_DELETE_CASCADE
Constants that define the different event types.

See Also:
Constant Field Values

VISUALNODE_PRE_ADD

public static final int VISUALNODE_PRE_ADD
Constants that define the different event types.

See Also:
Constant Field Values

VISUALNODE_PRE_REMOVE

public static final int VISUALNODE_PRE_REMOVE
Constants that define the different event types.

See Also:
Constant Field Values

VISUALEDGE_PRE_ADD

public static final int VISUALEDGE_PRE_ADD
Constants that define the different event types.

See Also:
Constant Field Values

VISUALEDGE_PRE_REMOVE

public static final int VISUALEDGE_PRE_REMOVE
Constants that define the different event types.

See Also:
Constant Field Values

ISOLATED_VISUALEDGE_PRE_ADD

public static final int ISOLATED_VISUALEDGE_PRE_ADD
Constants that define the different event types.

See Also:
Constant Field Values

ISOLATED_VISUALEDGE_PRE_REMOVE

public static final int ISOLATED_VISUALEDGE_PRE_REMOVE
Constants that define the different event types.

See Also:
Constant Field Values
Constructor Detail

VisualGraphEvent

public VisualGraphEvent(int eventid,
                        VisualGraph visualgraph)
Constructs a new VisualGraphEvent.

Parameters:
eventid - the id of the event.
visualgraph - the VisualGraph that is the source of the event.

VisualGraphEvent

public VisualGraphEvent(int eventid,
                        VisualSubgraph visualsubgraph)
Constructs a new VisualGraphEvent.

Parameters:
eventid - the id of the event.
visualsubgraph - the VisualSubgraph that is the source of the event.

VisualGraphEvent

public VisualGraphEvent(int eventid,
                        VisualGraph visualgraph,
                        VisualNode visualnode,
                        long visualnodeid)
Constructs a new VisualGraphEvent.

Parameters:
eventid - the id of the event.
visualgraph - the VisualGraph that is the source of the event.
visualnode - the visualnode that is subject of the event.
visualnodeid - the id of the subject visualnode.

VisualGraphEvent

public VisualGraphEvent(int eventid,
                        VisualSubgraph visualsubgraph,
                        VisualNode visualnode,
                        long visualnodeid)
Constructs a new VisualGraphEvent.

Parameters:
eventid - the id of the event.
visualsubgraph - the VisualSubgraph that is the source of the event.
visualnode - the visualnode that is subject of the event.
visualnodeid - the id of the subject visualnode.

VisualGraphEvent

public VisualGraphEvent(int eventid,
                        VisualGraph visualgraph,
                        VisualEdge visualedge,
                        long visualedgeid)
Constructs a new VisualGraphEvent.

Parameters:
eventid - the id of the event.
visualgraph - the VisualGraph that is the source of the event.
visualedge - the visualedge that is subject of the event.
visualedgeid - the id of the subject visualedge.

VisualGraphEvent

public VisualGraphEvent(int eventid,
                        VisualSubgraph visualsubgraph,
                        VisualEdge visualedge,
                        long visualedgeid)
Constructs a new VisualGraphEvent.

Parameters:
eventid - the id of the event.
visualsubgraph - the VisualSubgraph that is the source of the event.
visualedge - the visualedge that is subject of the event.
visualedgeid - the id of the subject visualedge.

VisualGraphEvent

public VisualGraphEvent(int eventid,
                        VisualGraph visualgraph,
                        VisualSubgraph visualsubgraph,
                        VisualNode visualnode,
                        VisualEdge visualedge,
                        long visualnodeid,
                        long visualedgeid,
                        VisualEdge newedge1,
                        VisualEdge newedge2)
Constructs a new VisualGraphEvent.

Parameters:
eventid - the id of the event.
visualgraph - the VisualGraph that is the source of the event.
visualsubgraph - the VisualSubgraph that is the source of the event.
visualnode - the visualnode that is subject of the event.
visualedge - the visualedge that is subject of the event.
visualnodeid - the id of the subject visualnode.
visualedgeid - the id of the subject visualedge.
newedge1 - the first new visualedge (in case of a split).
newedge2 - the second new visualedge (in case of a split).

VisualGraphEvent

public VisualGraphEvent(int eventid,
                        VisualGraph visualgraph,
                        VisualSubgraph visualsubgraph,
                        long vnID,
                        VisualNode vn,
                        long veID,
                        VisualEdge ve,
                        VisualGraphObjectContainer veVGOC,
                        VisualEdge veIn,
                        VisualGraphObjectContainer veInVGOC,
                        VisualEdge veOut,
                        VisualGraphObjectContainer veOutVGOC)
Method Detail

id2string

public static final java.lang.String id2string(int id)

getID

public int getID()
Returns the event id of this event.

Returns:
the event id of this event.

getSubjectVisualNodeID

public long getSubjectVisualNodeID()
Returns the subject visualnode id for this event. Only meaningful if the event is node-related.

Returns:
the subject visualnode id for this event.

getSubjectVisualNode

public VisualNode getSubjectVisualNode()
Returns the subject visualnode for this event. Only meaningful if the event is node-related.

Returns:
the subject visualnode for this event.

getSubjectVisualNodeContainer

public VisualGraphObjectContainer getSubjectVisualNodeContainer()

getSubjectVisualEdgeID

public long getSubjectVisualEdgeID()
Returns the subject visualedge id for this event. Only meaningful if the event is edge-related.

Returns:
the subject visualedge id for this event.

getSubjectVisualEdge

public VisualEdge getSubjectVisualEdge()
Returns the subject visualedge for this event. Only meaningful if the event is edge-related.

Returns:
the subject visualedge for this event.

getSubjectVisualEdgeContainer

public VisualGraphObjectContainer getSubjectVisualEdgeContainer()

getNewSplitEdge1

public VisualEdge getNewSplitEdge1()
If the event is an edgesplit event, this method will return the first of the two newly introduced edges that replace the original split edge.

Returns:
the first split edge.

getNewSplitEdge1Container

public VisualGraphObjectContainer getNewSplitEdge1Container()

getNewSplitEdge2

public VisualEdge getNewSplitEdge2()
If the event is an edgesplit event, this method will return the second of the two newly introduced edges that replace the original split edge.

Returns:
the second split edge.

getNewSplitEdge2Container

public VisualGraphObjectContainer getNewSplitEdge2Container()

getOldEdge1

public VisualEdge getOldEdge1()
If the event is an nodedelete-edge-cascade-event, this method will return the firstof the two previous edges that were replaced the new cascaded edge.

Returns:
the first split edge.

getOldEdge1Container

public VisualGraphObjectContainer getOldEdge1Container()

getOldEdge2

public VisualEdge getOldEdge2()
If the event is an nodedelete-edge-cascade-event, this method will return the second of the two previous edges that were replaced the new cascaded edge.

Returns:
the second split edge.

getOldEdge2Container

public VisualGraphObjectContainer getOldEdge2Container()

toString

public java.lang.String toString()

getVisualGraph

public VisualGraph getVisualGraph()
Returns the VisualGraph that caused the event.

If the event source was not of the type VisualGraph then this method returns null.

Specified by:
getVisualGraph in interface VisualGraphRootEvent
Returns:
the VisualGraph that caused the event.

getVisualSubgraph

public VisualSubgraph getVisualSubgraph()
Returns the VisualSubgraph that caused the event.

If the event source was not of the type VisualSubgraph then this method returns null.

Returns:
the VisualSubgraph that caused the event.

getDescription

public java.lang.String getDescription()
Returns a textual description for the event.

Specified by:
getDescription in interface VisualGraphRootEvent
Returns:
a textual description for the event.


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