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.
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
Implemented in
ReparentNodeHandler.isReparentGestureDetermines whether the provided node may be reparented to this potential newParent.
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
nullfor the root (no parent). Can be a group or a non-group node.
Return Value
- boolean
- Whether
newParentis a valid new parent fornode.
See Also
Developer's Guide
Implemented in
ReparentNodeHandler.isValidParentPerforms the actual reparenting after the reparent gesture has been finalized.
Performs the actual reparenting after the reparent gesture has been finalized.
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
nullfor the root (no parent). Can be a group or a non-group node.
See Also
Developer's Guide
Implemented in
ReparentNodeHandler.reparentDetermines whether the user may detach the given node from its current parent in order to reparent it.
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