com.mindfusion.diagramming
Class NodeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.mindfusion.diagramming.NodeEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ContainerChildEvent, NodeValidationEvent

public class NodeEvent
extends java.util.EventObject

Contains the arguments passed to handlers of node-related events, such as TreeCollapsed and TreeExpanded.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
NodeEvent(java.lang.Object source, DiagramNode node)
          Represents methods that will handle general node related events.
NodeEvent(java.lang.Object source, DiagramNode node, int mouseButton, java.awt.geom.Point2D mousePosition)
          Initializes a new instance of the NodeEvent class.
NodeEvent(java.lang.Object source, DiagramNode node, java.awt.geom.Point2D mousePosition, int adjustmentHandle)
          Initializes a new instance of the NodeEvent class.
 
Method Summary
 int getAdjustmentHandle()
          Gets the adjustment handle being moved by the user.
 int getMouseButton()
          Gets which mouse button has been pressed.
 java.awt.geom.Point2D getMousePosition()
          Gets the current mouse pointer position.
 DiagramNode getNode()
          Gets the node for which the event was raised.
 void setAdjustmentHandle(int adjustmentHandle)
          Sets the adjustment handle being moved by the user.
 void setMousePosition(java.awt.geom.Point2D mousePosition)
          Sets the current mouse pointer position.
 
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

NodeEvent

public NodeEvent(java.lang.Object source,
                 DiagramNode node)
Represents methods that will handle general node related events.

Parameters:
source - The source of the event.
node - The DiagramNode related to the event.

NodeEvent

public NodeEvent(java.lang.Object source,
                 DiagramNode node,
                 java.awt.geom.Point2D mousePosition,
                 int adjustmentHandle)
Initializes a new instance of the NodeEvent class.

Parameters:
source - The source of the event.
node - The DiagramNode related to the event.
mousePosition - The mouse button related to the event.
adjustmentHandle - The position of the mouse cursor, in document coordinates.

NodeEvent

public NodeEvent(java.lang.Object source,
                 DiagramNode node,
                 int mouseButton,
                 java.awt.geom.Point2D mousePosition)
Initializes a new instance of the NodeEvent class.

Parameters:
source - The source of the event.
node - The DiagramNode related to the event.
mouseButton - The position of the mouse cursor, in document coordinates.
mousePosition - The zero-based index of the control point related to the event.
Method Detail

getAdjustmentHandle

public int getAdjustmentHandle()
Gets the adjustment handle being moved by the user.

Returns:
A member of the AdjustmentHandles enumeration specifying what handle has been used.

setAdjustmentHandle

public void setAdjustmentHandle(int adjustmentHandle)
Sets the adjustment handle being moved by the user.

Parameters:
adjustmentHandle - A member of the AdjustmentHandles enumeration.

getNode

public DiagramNode getNode()
Gets the node for which the event was raised.

Returns:
An instance of the DiagramNode class.

getMouseButton

public int getMouseButton()
Gets which mouse button has been pressed.

Returns:
the currently pressed mouse button.

getMousePosition

public java.awt.geom.Point2D getMousePosition()
Gets the current mouse pointer position.

Returns:
A Point2D object specifying the current mouse position.

setMousePosition

public void setMousePosition(java.awt.geom.Point2D mousePosition)
Sets the current mouse pointer position.

Parameters:
mousePosition - A Point2D object specifying the current mouse position.