The default IReparentNodeHandler implementation used by reparentNodeHandler.
Remarks
It treats Ctrl key presses as reparent gestures. This can be configured using the reparentRecognizer property. By default, all nodes can be reparented to all other nodes.
Type Details
- yFiles module
- view
Properties
Gets or sets the event recognizer which is called by isReparentGesture to determine whether to reparent a node.
Remarks
The default detects the current platform and delegates either to META_IS_DOWN (macOS) or CTRL_IS_DOWN (other platforms).
Signature Details
function(evt: EventArgs, eventSource: unknown) : boolean
A callback that recognizes events.
Given a sender and an event argument, delegates decide whether the event is treated as a match depending on the context.
Parameters
- evt - EventArgs
- The arguments of the event to be decided to handle.
- eventSource - unknown
- The source of the event.
Returns
- boolean
trueif theevtis considered to be handled.
See Also
Methods
Determines whether the current gesture that can be determined through the context is a reparent gesture.
Remarks
By default, reparentRecognizer will be tested with the lastInputEvent.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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.
Returns
- ↪boolean
- Whether this is a reparenting gesture.
Implements
Determines whether the provided node may be reparented to a newParent.
Remarks
By default, all nodes are considered valid parents.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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.
Returns
- ↪boolean
- Whether
newParentis a valid new parent fornode.
Implements
Performs the actual reparenting after the reparent gesture has been finalized.
Remarks
The default implementation sets the parent of
node to newParent and enlarges the parent to fit the reparented node.Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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.
Implements
Determines whether the user may detach the given node from its current parent in order to reparent it.
Remarks
By default, all nodes may be detached.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- 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.
Returns
- ↪boolean
- Whether the node may be detached and reparented.