com.mindfusion.diagramming
Class LinkValidationEvent

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

public class LinkValidationEvent
extends LinkEvent

Contains the arguments passed to handlers of link validation events.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
LinkValidationEvent(java.lang.Object source, DiagramLink link)
          Represents methods that will handle link validation events.
LinkValidationEvent(java.lang.Object source, DiagramLink link, java.awt.geom.Point2D mousePosition, int adjustmentHandle, DiagramNode node, int anchorIndex, int tableRow)
           
LinkValidationEvent(java.lang.Object source, DiagramLink link, java.awt.geom.Rectangle2D selectionRectangle)
           
 
Method Summary
 void cancelDrag()
          Cancels the creation or modification of the link.
 int getAnchorIndex()
          Gets the anchor point related to a link validation event.
 boolean getCancel()
          Gets a value indicating whether to cancel the current operation.
 boolean getChangingDestination()
          Gets a value indicating whether the user modifies the link's destination end point.
 boolean getChangingOrigin()
          Gets a value indicating whether the user modifies the link's origin end point.
 DiagramNode getDestination()
          Gets the node that will become the link's destination if the event is validated.
 DiagramNode getNode()
          Gets the node to which the link will be connected.
 DiagramNode getOrigin()
          Gets the node that would become the link's origin if the event is validated.
 java.awt.geom.Rectangle2D getSelectionRectangle()
          Gets the current selection rectangle.
 int getTableRow()
          Gets the table row related to a link validation event.
 void setCancel(boolean cancel)
          Sets a value indicating whether to cancel the current operation.
 
Methods inherited from class com.mindfusion.diagramming.LinkEvent
getAdjustmentHandle, getLink, getMouseButton, getMousePosition, setAdjustmentHandle, setMousePosition
 
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

LinkValidationEvent

public LinkValidationEvent(java.lang.Object source,
                           DiagramLink link)
Represents methods that will handle link validation events.

Parameters:
source - The source of the validation event.
link - A LinkValidationEvent that contains the event data.

LinkValidationEvent

public LinkValidationEvent(java.lang.Object source,
                           DiagramLink link,
                           java.awt.geom.Point2D mousePosition,
                           int adjustmentHandle,
                           DiagramNode node,
                           int anchorIndex,
                           int tableRow)

LinkValidationEvent

public LinkValidationEvent(java.lang.Object source,
                           DiagramLink link,
                           java.awt.geom.Rectangle2D selectionRectangle)
Method Detail

cancelDrag

public void cancelDrag()
Cancels the creation or modification of the link.


getNode

public DiagramNode getNode()
Gets the node to which the link will be connected.

Returns:
An instance of the DiagramNode class.

getOrigin

public DiagramNode getOrigin()
Gets the node that would become the link's origin if the event is validated.

Returns:
An instance of the DiagramNode class.

getDestination

public DiagramNode getDestination()
Gets the node that will become the link's destination if the event is validated.

Returns:
An instance of the DiagramNode class.

getCancel

public boolean getCancel()
Gets a value indicating whether to cancel the current operation.

Returns:
true to cancel the operation; false to approve it.

setCancel

public void setCancel(boolean cancel)
Sets a value indicating whether to cancel the current operation.

Parameters:
cancel - true to cancel the operation; false to approve it.

getAnchorIndex

public int getAnchorIndex()
Gets the anchor point related to a link validation event.

Returns:
An integer value specifying the index of an anchor point within an AnchorPattern.

getTableRow

public int getTableRow()
Gets the table row related to a link validation event.

Returns:
An integer value specifying the zero-based index of a TableNode's row.

getChangingOrigin

public boolean getChangingOrigin()
Gets a value indicating whether the user modifies the link's origin end point.

Returns:
true if the user is changing the origin point; otherwise, false.

getChangingDestination

public boolean getChangingDestination()
Gets a value indicating whether the user modifies the link's destination end point.

Returns:
true if the user is changing the destination point; otherwise, false.

getSelectionRectangle

public java.awt.geom.Rectangle2D getSelectionRectangle()
Gets the current selection rectangle.

Returns:
A Rectangle2D instance representing the selection rectangle.