com.mindfusion.diagramming
Class InteractionState

java.lang.Object
  extended by com.mindfusion.diagramming.InteractionState

public class InteractionState
extends java.lang.Object

Encapsulates the current state of user interaction with the control.


Constructor Summary
InteractionState(DiagramItem currentItem, int selectionHandle, int action)
          Initializes a new InteractionState instance.
 
Method Summary
 int getAction()
          Gets a value indicating what action is currently being performed.
 int getAdjustmentHandle()
          Gets the index of the selection handle used to modify the item.
 DiagramItem getCurrentItem()
          Gets the item being created or modified.
 Diagram getDiagram()
          Gets the current Diagram instance.
 DiagramNode getLinkTarget()
          Gets the current target node when a link is being modified.
 boolean getMouseMoved()
          Gets a value indicating whether the mouse pointer has moved since the user pressed down the mouse button
 java.awt.geom.Point2D.Float getStartPoint()
          Gets the coordinates of the point where the modification has started.
 void setLinkTarget(DiagramNode value)
          Sets the current target node when a link is being modified
 void setMouseMoved(boolean value)
          Sets a value indicating whether the mouse pointer has moved since the user pressed down the mouse button
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InteractionState

public InteractionState(DiagramItem currentItem,
                        int selectionHandle,
                        int action)
Initializes a new InteractionState instance.

Parameters:
currentItem - the item being interacted with
selectionHandle - index of the selection handle being dragged
action - one of the Action constants
Method Detail

getCurrentItem

public DiagramItem getCurrentItem()
Gets the item being created or modified.


getDiagram

public Diagram getDiagram()
Gets the current Diagram instance.

Returns:
An instance of the Diagram class.

getAdjustmentHandle

public int getAdjustmentHandle()
Gets the index of the selection handle used to modify the item.

Returns:
An integer value specifying which selection handle is dragged.

getAction

public int getAction()
Gets a value indicating what action is currently being performed.

Returns:
One of the Action constants.

getStartPoint

public java.awt.geom.Point2D.Float getStartPoint()
Gets the coordinates of the point where the modification has started.

Returns:
A Point2D.Float object specifying the start point coordinates.

getMouseMoved

public boolean getMouseMoved()
Gets a value indicating whether the mouse pointer has moved since the user pressed down the mouse button

Returns:
true if the mouse has moved; otherwise, false.

setMouseMoved

public void setMouseMoved(boolean value)
Sets a value indicating whether the mouse pointer has moved since the user pressed down the mouse button

Parameters:
value - true if the mouse has moved; otherwise, false

getLinkTarget

public DiagramNode getLinkTarget()
Gets the current target node when a link is being modified.

Returns:
A DiagramNode that the currently modified DiagramLink should connect to if the interaction completes at the current mouse position.

setLinkTarget

public void setLinkTarget(DiagramNode value)
Sets the current target node when a link is being modified

Parameters:
value - A DiagramNode that the currently modified DiagramLink should connect to if the interaction completes at the current mouse position.