Packagecom.yworks.graph.input
Interfacepublic interface IReparentStripeHandler
Implementors ReparentStripeHandler

Interface used for implementations that recognize, approve and disapprove stripe reparenting gestures, as well as actually performs the reparenting.

See also

ReparentStripePositionHandler


Public Methods
 MethodDefined By
  
canReparent(context:IInputModeContext, stripe:IStripe):Boolean
Determines whether the user may detach the given stripe from its current parent in order to reparent it.
IReparentStripeHandler
  
isValidParent(context:IInputModeContext, stripe:IStripe, newParent:IStripe, index:int, gesture:ReparentGesture):Boolean
Determines whether the provided node may be reparented to the given new parent.
IReparentStripeHandler
  
reparent(context:IInputModeContext, movedStripe:IStripe, newParent:IStripe, index:int, gesture:ReparentGesture):void
Performs the actual reparenting after the reparent gesture has been finalized.
IReparentStripeHandler
Method Detail
canReparent()method
public function canReparent(context:IInputModeContext, stripe:IStripe):Boolean

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

Parameters

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

Returns
Boolean — Whether the stripe may be detached and reparented.
isValidParent()method 
public function isValidParent(context:IInputModeContext, stripe:IStripe, newParent:IStripe, index:int, gesture:ReparentGesture):Boolean

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

This method is called to determine whether a reparent operation should actually be executed.

Parameters

context:IInputModeContext — The context that provides information about the user input.
 
stripe:IStripe — The stripe that will be reparented.
 
newParent:IStripe — The potential new parent.
 
index:int — The index where the stripe would be reparented.
 
gesture:ReparentGesture — The gesture that would be used for the reparent operation.

Returns
Boolean — Whether newParent is a valid new parent for stripe for the given index.
reparent()method 
public function reparent(context:IInputModeContext, movedStripe:IStripe, newParent:IStripe, index:int, gesture:ReparentGesture):void

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

Implementations should use ITable.setParentColumn(IColumn,IColumn,int) or ITable.setParentRow(IRow,IRow,int) to set the parent of movedStripe to newParent.

Parameters

context:IInputModeContext — The context that provides information about the user input.
 
movedStripe:IStripe — The stripe that will be reparented.
 
newParent:IStripe — The potential new parent.
 
index:int — The index where the stripe should be inserted.
 
gesture:ReparentGesture — The gesture that triggered the reparent operation.

See also