Packagecom.yworks.canvas.input
Interfacepublic interface IPositionHandler extends IDragHandler
Implementors CompositePositionHandler, DefaultPositionHandler, LabelPositionHandler, ReparentStripePositionHandler, SimpleEdgePositionHandler

Interface for an object that can handle the position of an item displayed in a CanvasComponent

Items can be dragged with the mouse and an instance of this class will modify their position accordingly. Typically client code will use the x and y coordinates to determine the current position of the elements. A drag will trigger the invocation of initializeDrag, zero or more handleMove calls, and finalized by either dragFinished or cancelDrag.



Public Properties
 PropertyDefined By
 Inheritedx : Number
[read-only] Returns the x coordinate of the current position of the element.
IDragHandler
 Inheritedy : Number
[read-only] Returns the y coordinate of the current position of the element.
IDragHandler
Public Methods
 MethodDefined By
 Inherited
cancelDrag(context:IInputModeContext, originalX:Number, originalY:Number):void
Called by clients to indicate that the dragging has been canceled by the user.
IDragHandler
 Inherited
dragFinished(context:IInputModeContext, originalX:Number, originalY:Number, newX:Number, newY:Number):void
Called by clients to indicate that the repositioning has just been finished.
IDragHandler
 Inherited
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.
IDragHandler
 Inherited
Called by clients to indicate that the element is going to be dragged.
IDragHandler
  
setPosition(x:Number, y:Number):void
Called by clients to set the position to the given coordinates.
IPositionHandler
Method Detail
setPosition()method
public function setPosition(x:Number, y:Number):void

Called by clients to set the position to the given coordinates.

It is up to the implementation to decide how the position of the element in question should be interpreted. This may be the upper left corner of the element, its center or anything else. The implementation may decide to not use the values provided or use different values internally.

Parameters

x:Number — The new x coordinate.
 
y:Number — The new y coordinate.