com.mindfusion.diagramming
Class LinkEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.mindfusion.diagramming.LinkEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LinkValidationEvent

public class LinkEvent
extends java.util.EventObject

Contains the arguments passed to handlers of link related events.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
LinkEvent(java.lang.Object source, DiagramLink link)
          Initializes a new LinkEvent instance.
LinkEvent(java.lang.Object source, DiagramLink link, int mouseButton, java.awt.geom.Point2D mousePosition)
          Initializes a new instance of the LinkEvent class.
LinkEvent(java.lang.Object source, DiagramLink link, java.awt.geom.Point2D mousePosition, int adjustmentHandle)
          Initializes a new instance of the LinkEvent class.
 
Method Summary
 int getAdjustmentHandle()
          Gets the adjustment handle being moved by the user.
 DiagramLink getLink()
          Gets the link for which the event raised.
 int getMouseButton()
          Gets which mouse button has been pressed.
 java.awt.geom.Point2D getMousePosition()
          Gets the current mouse pointer position.
 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

LinkEvent

public LinkEvent(java.lang.Object source,
                 DiagramLink link)
Initializes a new LinkEvent instance.

Parameters:
source - The sender of this event.
link - A LinkEvent that contains the event data.

LinkEvent

public LinkEvent(java.lang.Object source,
                 DiagramLink link,
                 java.awt.geom.Point2D mousePosition,
                 int adjustmentHandle)
Initializes a new instance of the LinkEvent class.

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

LinkEvent

public LinkEvent(java.lang.Object source,
                 DiagramLink link,
                 int mouseButton,
                 java.awt.geom.Point2D mousePosition)
Initializes a new instance of the LinkEvent class.

Parameters:
link - The DiagramLink 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:
An integer that represents the index of the link's control point being moved.

setAdjustmentHandle

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

Parameters:
adjustmentHandle - The index of the link's control point being moved.

getLink

public DiagramLink getLink()
Gets the link for which the event raised.

Returns:
A DiagramLink instance.

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.