Default implementation of the IReparentStripeHandler interface.
Remarks
This implementation allows to specify a maximal nesting depth for reparent operations.
Type Details
- yFiles module
- view
Constructors
Initializes a new instance of the ReparentStripeHandler class.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- maxRowLevel - number
- The maximum nesting level the row hierarchy may acquire during a reparent gesture. This option sets the maxRowLevel property on the created object.
- maxColumnLevel - number
- The maximum nesting level the column hierarchy may acquire during a reparent gesture. This option sets the maxColumnLevel property on the created object.
Properties
Gets or sets the maximum nesting level the column hierarchy may acquire during a reparent gesture.
Remarks
Note that it is always possible to decrease the nesting depth, even if the resulting depth would still be too high. This allows to interactively reduce an invalid nesting depth in multiple steps. The default value is
0x7FFFFFFF
, which effectively means an unlimited nesting depth.Gets or sets the maximum nesting level the row hierarchy may acquire during a reparent gesture.
Remarks
Note that it is always possible to decrease the nesting depth, even if the resulting depth would still be too high. This allows to interactively reduce an invalid nesting depth in multiple steps. The default value is
0x7FFFFFFF
, which effectively means an unlimited nesting depth.Methods
adjustSize
(context: IInputModeContext, stripe: IStripe, newParent: IStripe, reparentPosition: StripeReparentPolicy, index: number, originalStripeSize: number, originalParentSize: number)Adjust the size of the source or the target stripe.
Remarks
This implementation adjusts the size of
stripe
to Math.Max(originalStripeSize, originalParentSize)
if reparentPosition
is an ADD_CHILD operationParameters
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.
- stripe - IStripe
- The stripe that will be reparented.
- newParent - IStripe
- The potential new parent.
- reparentPosition - StripeReparentPolicy
- Where to place the stripe as a result of the gesture that triggered the reparent operation.
- index - number
- The index where the stripe should be inserted.
- originalStripeSize - number
- The original size of
stripe
- originalParentSize - number
- The original size of
newParent
isValidParent
(context: IInputModeContext, stripe: IStripe, newParent: IStripe, index: number, reparentPosition: StripeReparentPolicy) : booleanChecks the constraints imposed by maxRowLevel or maxColumnLevel for a valid gesture.
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.
- stripe - IStripe
- The stripe that will be reparented.
- newParent - IStripe
- The potential new parent.
- index - number
- The index where the stripe would be reparented
- reparentPosition - StripeReparentPolicy
- Where to place the stripe as a result of the gesture that would be used for the reparent operation.
Returns
- ↪boolean
true
iff the resulting nesting depth is smaller than maxRowLevel or maxColumnLevel, or if the nesting depth would not increase by the operation.
Implements
reparent
(context: IInputModeContext, stripe: IStripe, newParent: IStripe, index: number, reparentPosition: StripeReparentPolicy)Performs the actual reparenting after the reparent gesture has been finalized.
Remarks
This implementation adjusts the size of the moved and/or the target stripe by calling adjustSize.
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.
- stripe - IStripe
- The stripe that will be reparented.
- newParent - IStripe
- The potential new parent.
- index - number
- The index where the stripe should be inserted.
- reparentPosition - StripeReparentPolicy
- Where to place the stripe as a result of the gesture that triggered the reparent operation.
Implements
Determines whether the user may detach the given stripe from its current parent in order to reparent it.
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.
- stripe - IStripe
- The stripe that is about to be detached from its current parent.
Returns
- ↪boolean
- This implementation returns always
true
.