C

ReparentStripePositionHandler

Customized IPositionHandler implementation that moves a stripe in the table hierarchy when the stripe is dragged.

Remarks

This class is used by default by both ReparentStripeInputMode and StripeDropInputMode to perform the actual reparenting and insertion.

Members

Show:

Constructors

Creates a new instance of this position handler which moves movedStripe.

Parameters

movedStripe: IStripe

Properties

Gets the current IInputModeContext
protectedreadonlyfinal
Gets a view of the location of the item.
The point describes the current world coordinate of the element that can be modified by this handler.
readonlyfinal
Gets the moved stripe.
readonlyfinal

Methods

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.
final

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.
originalLocation: Point
The value of the coordinate of the location property at the time of initializeDrag.
Create a ghost object for the source region of the reparent gesture.
The default implementation uses the return value of getVisualCreator with type DRAG_SOURCE.
protected

Parameters

context: IInputModeContext
The current input mode context

Return Value

IRenderTreeElement
A render tree element that is used to visualize the target region.

See Also

API
updateSourceGhost
Create a ghost visualization for the target region of the reparent gesture.
The default implementation uses the return value of getVisualCreator with type DROP_TARGET.
protected

Parameters

context: IInputModeContext
The current input mode context
stripe: IStripe
The stripe for which the visualization should be created.

Return Value

IRenderTreeElement
A render tree element that is used to visualize the target region.

See Also

API
updateTargetGhost
Determine the reparent gesture that would result from the given parameters.
The target region has already been determined by getTargetSubregion
protected

Parameters

context: IInputModeContext
The current input mode context
location: IPoint
The current drag location
sourceStripe: IStripe
The stripe that is moved
targetSubregion: StripeSubregion
The stripe subregion for the target.
targetBounds: Rect
The target bounds

Return Value

StripeReparentPolicy
A StripeReparentPolicy that specifies the operation to perform.
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.
final

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.
originalLocation: Point
The value of the location property at the time of initializeDrag.
newLocation: Point
The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the implementation the location may or may not be modified to reflect the new value. This is the same value as delivered in the last invocation of handleMove.
Finds the target stripe subregion at location and its associated owner node.
protected

Parameters

location: Point
The hit location.

Return Value

StripeSubregion
A StripeSubregion that lies at location, or null if no such region could be found.
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 the final call will be followed by either one dragFinished or one cancelDrag call.
final

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.
originalLocation: Point
The value of the location property at the time of initializeDrag.
newLocation: Point
The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the implementation, the location may or may not be modified to reflect the new value.
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.
final

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.
Called whenever a change in the oldTable hierarchy occurs through this position handler.
protected

Parameters

evt: StripeEventArgs
Called by clients to set the position to the given coordinates.
final

Parameters

location: Point
The new location.

See Also

API
location
Updates the source ghost visualization after a drag.
The default does not change sourceGhost.
protected

Parameters

context: IInputModeContext
The current input mode context.
sourceGhost: IRenderTreeElement
The render tree element that represents the source ghost.
movedStripe: IStripe
The IStripe which is moved by this reparent gesture.
reparentPosition: StripeReparentPolicy
Where to place the stripe after reparenting.

Return Value

IRenderTreeElement
An updated render tree element for the source ghost.
Modifies the target ghost visualization after a drag.
The default implementation only hides targetGhost iff reparentPosition is INVALID.
protected

Parameters

context: IInputModeContext
The current input mode context.
targetGhost: IRenderTreeElement
The render tree element for the target visualization.
targetStripe: IStripe
The target for the reparent gesture.
reparentPosition: StripeReparentPolicy
The mode that describes the results of the reparent gesture.
targetBounds: Rect
The current visualization bounds that have been computed with updateTargetGhostBounds.

Return Value

IRenderTreeElement
An updated render tree element for the target ghost.
Updates the visualization bounds for the target visualization depending on the provided values.
protected

Parameters

originalTargetBounds: Rect
The target bounds prior to this method call.
reparentPosition: StripeReparentPolicy
Where to place the stripe after the reparenting operations according to the reparent gesture.
targetStripe: IStripe
The target stripe which has been determined by the input mode.

Return Value

Rect
Updated bounds for the target visualization.

Events

Occurs when a stripe state is changed by this input mode.

Properties of

StripeEventArgs
item: IStripe
Gets the item that is the subject of the event.
parentStripe: IStripe
Gets the parent of the stripe that owned the stripe before the event happened.
table: ITable
Gets the table that owned the stripe before the event happened.