y.view
Class Graph2DSelectionEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--y.view.Graph2DSelectionEvent
All Implemented Interfaces:
Serializable

public class Graph2DSelectionEvent
extends EventObject

An event which indicates that the selection state of an edge, a bend or a node in a Graph2D has changed. This event is generated by Bend, Node- or EdgeRealizer whose selection state changes.

The event is passed to every Graph2DSelectionListener object that registered to receive such events using the Graph2D's Graph2D.addGraph2DSelectionListener(y.view.Graph2DSelectionListener) method.

The object that implements the Graph2DSelectionListener interface gets this Graph2DSelectionEvent when the event occurs.

Each Graph2DSelectionEvent has a subject whose selection state changed. The subject can either be of type Node, Bend or of type Edge.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
Graph2DSelectionEvent(Graph2D source, Object subject)
          Creates a new Instance of GraphEvent with given type and data
 
Method Summary
 Graph2D getGraph2D()
          Returns the graph that is the emitter of this event.
 Object getSubject()
          Returns the subject whose selection state changed.
 boolean isBendSelection()
          Returns whether or not the subject is of type Bend.
 boolean isEdgeSelection()
          Returns whether or not the subject is of type Edge.
 boolean isNodeSelection()
          Returns whether or not the subject is of type Node.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Graph2DSelectionEvent

public Graph2DSelectionEvent(Graph2D source,
                             Object subject)
Creates a new Instance of GraphEvent with given type and data

Method Detail

isNodeSelection

public boolean isNodeSelection()
Returns whether or not the subject is of type Node.


isEdgeSelection

public boolean isEdgeSelection()
Returns whether or not the subject is of type Edge.


isBendSelection

public boolean isBendSelection()
Returns whether or not the subject is of type Bend.


getSubject

public Object getSubject()
Returns the subject whose selection state changed. The subject is either of type Node or of type Edge.


getGraph2D

public Graph2D getGraph2D()
Returns the graph that is the emitter of this event.


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

2003