Packagecom.yworks.graph.input
Classpublic class CompoundMovePortHandle
InheritanceCompoundMovePortHandle Inheritance Object
Implements IHandle

A handle implementation that delegates to either a PortRelocationHandle to reassign an edge to a different port or to a handle that moves a port.

The active handle delegate is determined by the alternativeHandleRecognizer property event recognizer function.



Public Properties
 PropertyDefined By
  alternativeHandleRecognizer : Function
[read-only] The event recognizer function that determines which delegate handle will be active.
CompoundMovePortHandle
  alternativeHandlerRecognizer : Function
[write-only]
CompoundMovePortHandle
  cursor : Cursor
[read-only] Provides the cursor to display when the mouse hovers over or drags this handle.
CompoundMovePortHandle
  type : uint
[read-only] Returns the type of the handle that can be used by the rendering engine to render types differently.
CompoundMovePortHandle
  x : Number
[read-only] Returns the x coordinate of the current position of the element.
CompoundMovePortHandle
  y : Number
[read-only] Returns the y coordinate of the current position of the element.
CompoundMovePortHandle
Public Methods
 MethodDefined By
  
CompoundMovePortHandle(edge:IEdge, sourceHandle:Boolean)
Creates a new instance of the compound handle.
CompoundMovePortHandle
  
cancelDrag(context:IInputModeContext, originalX:Number, originalY:Number):void
Called by clients to indicate that the dragging has been canceled by the user.
CompoundMovePortHandle
  
dragFinished(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):void
Called by clients to indicate that the repositioning has just been finished.
CompoundMovePortHandle
  
handleMove(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):Boolean
Called by clients to indicate that the element has been dragged and its position should be updated.
CompoundMovePortHandle
  
Called by clients to indicate that the element is going to be dragged.
CompoundMovePortHandle
Property Detail
alternativeHandleRecognizerproperty
alternativeHandleRecognizer:Function  [read-only]

The event recognizer function that determines which delegate handle will be active.


Implementation
    public function get alternativeHandleRecognizer():Function
alternativeHandlerRecognizerproperty 
alternativeHandlerRecognizer:Function  [write-only]


Implementation
    public function set alternativeHandlerRecognizer(value:Function):void
cursorproperty 
cursor:Cursor  [read-only]

Provides the cursor to display when the mouse hovers over or drags this handle.


Implementation
    public function get cursor():Cursor
typeproperty 
type:uint  [read-only]

Returns the type of the handle that can be used by the rendering engine to render types differently.


Implementation
    public function get type():uint
xproperty 
x:Number  [read-only]

Returns the x coordinate of the current position of the element.

The point describes the current world coordinate position of the element. It is up to the implementation how this position is interpreted. The values returned by this method will be used for the "originalX" parameter in the handleMove, cancelDrag and dragFinished methods.


Implementation
    public function get x():Number
yproperty 
y:Number  [read-only]

Returns the y coordinate of the current position of the element.

The point describes the current world coordinate position of the element. It is up to the implementation how this position is interpreted. The values returned by this method will be used for the "originalY" parameter in the handleMove, cancelDrag and dragFinished methods.


Implementation
    public function get y():Number
Constructor Detail
CompoundMovePortHandle()Constructor
public function CompoundMovePortHandle(edge:IEdge, sourceHandle:Boolean)

Creates a new instance of the compound handle.

Parameters
edge:IEdge — The edge to be changed through the handles
 
sourceHandle:Boolean — whether to change the source port
Method Detail
cancelDrag()method
public function cancelDrag(context:IInputModeContext, originalX:Number, originalY:Number):void

Called by clients to indicate that the dragging has been canceled by the user.

This method may be called after the initial initializeDrag and zero or more invocations of handleMove. Implementations should reset the position of the items they modify to their initial state. Alternatively to this method the dragFinished method might be called.

Parameters

context:IInputModeContext — The context to retrieve information about the drag from.
 
originalX:Number — The value of the x property at the time of initializeDrag.
 
originalY:Number — The value of the y property at the time of initializeDrag.

dragFinished()method 
public function dragFinished(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):void

Called by clients to indicate that the repositioning has just been finished. This method may be called after the initial initializeDrag and zero or more invocations of handleMove. Alternatively to this method the cancelDrag method might be called.

Parameters

context:IInputModeContext — The context to retrieve information about the drag from.
 
originalX:Number — The value of the x property at the time of initializeDrag.
 
originalY:Number — The value of the y property at the time of initializeDrag.
 
newX:Number — The value of the x coordinate in the world coordinate system that the client wants the handle to be at. Depending on the implementation the x and y properties or may not be modified to reflect the new value. This is the same value as delivered in the last invocation of handleMove.
 
newY:Number — The value of the y coordinate in the world coordinate system that the client wants the handle to be at. Depending on the implementation the x and y properties or may not be modified to reflect the new value. This is the same value as delivered in the last invocation of handleMove.

handleMove()method 
public function handleMove(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):Boolean

Called by clients to indicate that the element has been dragged and its position should be updated.

This method may be called more than once after an initial initializeDrag and will be followed by either dragFinished or cancelDrag.

Parameters

context:IInputModeContext — The value of the x property at the time of initializeDrag.
 
originalX:Number — The value of the y property at the time of initializeDrag.
 
originalY:Number — The value of the x coordinate in the world coordinate system that the client wants the handle to be at. Depending on the implementation the x property may or may not be modified to reflect the new value.
 
newX:Number — The value of the y coordinate in the world coordinate system that the client wants the handle to be at. Depending on the implementation the y property may or may not be modified to reflect the new value.
 
newY:Number

Returns
Boolean — Whether the move had any visual effect. This is a hint to the engine to optimize invalidation.
initializeDrag()method 
public function initializeDrag(context:IInputModeContext):void

Called by clients to indicate that the element is going to be dragged.

This call will be followed by one or more calls to handleMove, and a final dragFinished or cancelDrag.

Parameters

context:IInputModeContext — The context to retrieve information about the drag from.