Package | com.yworks.graph.input |
Class | public class ReparentStripeHandler |
Inheritance | ReparentStripeHandler Object |
Implements | IReparentStripeHandler |
IReparentStripeHandler
interface.
This implementation allows to specify a maximal nesting depth for reparent operations.
Property | Defined By | ||
---|---|---|---|
maxColumnLevel : int
The maximum nesting level the column hierarchy may acquire during a reparent gesture. | ReparentStripeHandler | ||
maxRowLevel : int
The maximum nesting level the row hierarchy may acquire during a reparent gesture. | ReparentStripeHandler |
Method | Defined By | ||
---|---|---|---|
Determines whether the user may detach the given stripe from its current parent in
order to reparent it. | ReparentStripeHandler | ||
isValidParent(context:IInputModeContext, stripe:IStripe, newParent:IStripe, index:int, gesture:ReparentGesture):Boolean
Checks the constraints imposed by maxRowLevel or
maxColumnLevel for a valid gesture. | ReparentStripeHandler | ||
reparent(context:IInputModeContext, movedStripe:IStripe, newParent:IStripe, index:int, gesture:ReparentGesture):void
Performs the actual reparenting after the reparent gesture has been finalized. | ReparentStripeHandler |
Method | Defined By | ||
---|---|---|---|
adjustSize(context:IInputModeContext, movedStripe:IStripe, newParent:IStripe, gesture:ReparentGesture, index:int, originalStripeSize:Number, originalParentSize:Number):void
Adjust the size of the source or the target stripe. | ReparentStripeHandler |
maxColumnLevel | property |
maxColumnLevel:int
The maximum nesting level the column hierarchy may acquire during a reparent gesture.
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 int.MAX_VALUE
.
public function get maxColumnLevel():int
public function set maxColumnLevel(value:int):void
maxRowLevel | property |
maxRowLevel:int
The maximum nesting level the row hierarchy may acquire during a reparent gesture.
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 int.MAX_VALUE
.
public function get maxRowLevel():int
public function set maxRowLevel(value:int):void
adjustSize | () | method |
protected function adjustSize(context:IInputModeContext, movedStripe:IStripe, newParent:IStripe, gesture:ReparentGesture, index:int, originalStripeSize:Number, originalParentSize:Number):void
Adjust the size of the source or the target stripe.
This implementation adjusts the size of the moved stripe to
Math.Max(originalStripeSize, originalParentSize)
if the reparenting operation
is to add the child.
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.
| |
gesture:ReparentGesture — The gesture that triggered the reparent operation.
| |
index:int — The index where the stripe should be inserted.
| |
originalStripeSize:Number — The original size of the given stripe.
| |
originalParentSize:Number — The original size of the given parent.
|
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.
|
Boolean — This implementation returns always true .
|
isValidParent | () | method |
public function isValidParent(context:IInputModeContext, stripe:IStripe, newParent:IStripe, index:int, gesture:ReparentGesture):Boolean
Checks the constraints imposed by maxRowLevel
or
maxColumnLevel
for a valid gesture.
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.
|
Boolean — true iff the resulting nesting depth is smaller than
maxRowLevel or maxColumnLevel , or if the nesting depth
would not be increased by the operation.
|
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.
This implementation adjusts the size of the moved and/or the target stripe by calling
adjustSize
.
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.
|