public interface IReparentStripeHandler
ReparentStripePositionHandler
Modifier and Type | Method and Description |
---|---|
boolean |
isValidParent(IInputModeContext context,
IStripe stripe,
IStripe newParent,
int index,
StripeReparentPolicy reparentPosition)
Determines whether the provided node may be reparented to a
newParent . |
void |
reparent(IInputModeContext context,
IStripe movedStripe,
IStripe newParent,
int index,
StripeReparentPolicy reparentPosition)
Performs the actual reparenting after the reparent gesture has been finalized.
|
boolean |
shouldReparent(IInputModeContext context,
IStripe stripe)
Determines whether the user may detach the given stripe from its current parent in order to reparent it.
|
boolean isValidParent(IInputModeContext context, IStripe stripe, IStripe newParent, int index, StripeReparentPolicy reparentPosition)
newParent
.
This method is called to determine whether a reparent(IInputModeContext, IStripe, IStripe, int, StripeReparentPolicy)
operation should actually be executed.
context
- The context that provides information about the user input.stripe
- The stripe that will be reparented.newParent
- The potential new parent.index
- The index where the stripe would be
reparented
reparentPosition
- Where to place the stripe as a result of the gesture that would be used for the reparent(IInputModeContext, IStripe, IStripe, int, StripeReparentPolicy)
operation.newParent
is a valid new parent for stripe
for the given index and gesture.void reparent(IInputModeContext context, IStripe movedStripe, IStripe newParent, int index, StripeReparentPolicy reparentPosition)
Implementations should use ITable.setParent(com.yworks.yfiles.graph.IColumn, com.yworks.yfiles.graph.IColumn, int)
or ITable.setParent(com.yworks.yfiles.graph.IRow, com.yworks.yfiles.graph.IRow, int)
to
set the parent of movedStripe
to newParent
.
context
- The context that provides information about the user input.movedStripe
- The stripe that will be reparented.newParent
- The potential new parent.index
- The index where the stripe should be inserted.reparentPosition
- Where to place the stripe as a result of the gesture that triggered the reparent operation.boolean shouldReparent(IInputModeContext context, IStripe stripe)
context
- The context that provides information about the user input.stripe
- The stripe that is about to be detached from its current parent.