I

IReparentNodeHandler

Interface used for implementations that recognize, approve, and disapprove node reparenting gestures, as well as actually perform the reparenting.
Inheritance Hierarchy

Remarks

If possible, it's recommended to rather inherit class ReparentNodeHandler as it provides more convenience for determining whether a gesture is a reparent gesture.

Implementations of this interface are meant to be registered at the reparentNodeHandler property and are queried from the IInputModeContext by code that wants to reparent a node. Specifically, this is used by default to reparent nodes during the dragging of nodes.

During a drag gesture this interface is queried if the gesture is generally a reparent gesture, the user may detach the dragged node from its current parent and if a potential new parent is valid.

See Also

Developer's Guide

Demos

Shows how reparenting of nodes can be customized.

Members

No filters for this type

Methods

Determines whether the current user input that can be determined through the context is a reparent gesture.
The actual reparenting is only performed if this method, shouldReparent, and isValidParent return true.
abstract

Parameters

context: IInputModeContext
The context that provides information about the user input.
node: INode
The node that will possibly be reparented. May be irrelevant for the result.

Return Value

boolean
Whether this is a reparenting gesture.

See Also

Developer's Guide
Determines whether the provided node may be reparented to this potential newParent.
abstract

Parameters

context: IInputModeContext
The context that provides information about the user input.
node: INode
The node that will be reparented.
newParent: INode
The potential new parent or null for the root (no parent). Can be a group or a non-group node.

Return Value

boolean
Whether newParent is a valid new parent for node.

See Also

Developer's Guide
Performs the actual reparenting after the reparent gesture has been finalized.
Implementations should set the parent of node to newParent.
abstract

Parameters

context: IInputModeContext
The context that provides information about the user input.
node: INode
The node that will be reparented.
newParent: INode
The potential new parent or null for the root (no parent). Can be a group or a non-group node.

See Also

Developer's Guide
Determines whether the user may detach the given node from its current parent in order to reparent it.
The actual reparenting is only performed if this method, shouldReparent, and isValidParent return true.
abstract

Parameters

context: IInputModeContext
The context that provides information about the user input.
node: INode
The node that is about to be detached from its current parent.

Return Value

boolean
Whether the node may be detached and reparented.

See Also

Developer's Guide

Static Methods

static

Parameters

Return Value

IReparentNodeHandler