Package | com.yworks.canvas.input |
Interface | public interface IPositionHandler extends IDragHandler |
Implementors | CompositePositionHandler, DefaultPositionHandler, LabelPositionHandler, ReparentStripePositionHandler, SimpleEdgePositionHandler |
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
.
Method | Defined By | ||
---|---|---|---|
cancelDrag(context:IInputModeContext, originalX:Number, originalY:Number):void
Called by clients to indicate that the dragging has been canceled by the user. | IDragHandler | ||
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 | ||
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 | ||
initializeDrag(context:IInputModeContext):void
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 |
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.
|