Packagecom.yworks.graph.input
Interfacepublic interface IReparentNodeHandler
Implementors ReparentNodeHandler

Interface used for implementations that recognize, approve and disapprove node reparenting gestures.

Implementations of this interface are queried from the IInputModeContext by code that wants to reparent a node. Specifically this is used by the implementation provided by GroupedGraph that will be used to reparent nodes during the dragging of nodes.

See also

com.yworks.canvas.input.MoveInputMode


Public Methods
 MethodDefined By
  
canReparent(context:IInputModeContext, node:INode):Boolean
Determines whether the user may detach the given node from its current parent in order to reparent it.
IReparentNodeHandler
  
Determines whether the current gesture that can be determined through the context is a reparent gesture.
IReparentNodeHandler
  
isValidParent(context:IInputModeContext, node:INode, newParent:INode):Boolean
Determines whether the provided node may be reparented to a new parent.
IReparentNodeHandler
  
reparent(context:IInputModeContext, node:INode, newParent:INode):void
Performs the actual reparenting after the reparent gesture has been finalized.
IReparentNodeHandler
Method Detail
canReparent()method
public function canReparent(context:IInputModeContext, node:INode):Boolean

Determines whether the user may detach the given node from its current parent in order to reparent it.

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.

Returns
Boolean — Whether the node may be detached and reparented.
isReparentGesture()method 
public function isReparentGesture(context:IInputModeContext, node:INode):Boolean

Determines whether the current gesture that can be determined through the context is a reparent gesture.

Parameters

context:IInputModeContext — The context that provides information about the user input.
 
node:INode — The node that will possibly be reparented.

Returns
Boolean — Whether this is a reparenting gesture.
isValidParent()method 
public function isValidParent(context:IInputModeContext, node:INode, newParent:INode):Boolean

Determines whether the provided node may be reparented to a new parent.

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.

Returns
Boolean — Whether newParent is a valid new parent for node.
reparent()method 
public function reparent(context:IInputModeContext, node:INode, newParent:INode):void

Performs the actual reparenting after the reparent gesture has been finalized.

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.