| Package | com.asterisq.constellation.behaviors |
| Class | public class VelocityReductionBehavior |
| Inheritance | VelocityReductionBehavior Behavior flash.events.EventDispatcher |
Dispatches an Event.COMPLETE event after the delay and the
duration when the velocity has been reduced to zero.
If autoStart is set to true, the velocity limit
will be reset and the countdown restarted when the node renderers change. This
is triggered by the Event.CHANGE event.
If autoStart is set to true and a node renderer is
pressed, the velocity limit will be reset. In this case the countdown won't
restart until the mouse is released.
| Property | Defined by | ||
|---|---|---|---|
| autoStart : Boolean
Indicates whether the timer should restart automatically when the graph changes.
| VelocityReductionBehavior | ||
| constellation : IConstellation
The constellation instance this behavior belongs to.
| VelocityReductionBehavior | ||
| delay : Number
The delay, in milliseconds, before starting to reduce the velocity.
| VelocityReductionBehavior | ||
| duration : Number
The length of time over which the velocity is reduced to zero.
| VelocityReductionBehavior | ||
![]() | enabled : Boolean
Indicates whether this behavior is currently enabled.
| Behavior | |
| initialVelocityLimit : Number
The initial velocity limit applied to each node renderer.
| VelocityReductionBehavior | ||
![]() | nodeRendererFilterFunction : Function
The function which determines the node renderers affected by this behavior.
| Behavior | |
| Method | Defined by | ||
|---|---|---|---|
|
VelocityReductionBehavior(initialVelocityLimit:Number = 20, delay:Number = 5000, duration:Number = 1000, autoStart:Boolean = true, autoPause:Boolean = true)
Creates a new velocity reduction behavior.
| VelocityReductionBehavior | ||
![]() |
affectsAcceleration():Boolean
Indicates whether this class affects node renderers' acceleration.
| Behavior | |
![]() |
affectsNodeRenderer(nr:INodeRenderer):Boolean
Determines whether this behavior affects the given node renderer.
| Behavior | |
![]() |
affectsPosition():Boolean
Indicates whether this class affects node renderers' position.
| Behavior | |
|
affectsVelocity():Boolean
Indicates whether this class affects node renderers' velocity.
| VelocityReductionBehavior | ||
![]() |
[static]
Creates an IBehavior instance and initializes it with the given XML data.
| Behavior | |
|
reset():void
Stops the delay countdown and resets the velocity limit to the initial value.
| VelocityReductionBehavior | ||
|
restart():void
Equivalent to a call to
reset() followed by start(). | VelocityReductionBehavior | ||
|
start():void
Starts the delay countdown timer.
| VelocityReductionBehavior | ||
![]() |
stepEnd():void
Method called at the end of a step.
| Behavior | |
|
stepStart():void
Method called at the beginning of a step.
| VelocityReductionBehavior | ||
![]() |
Modifies the given node renderer's acceleration.
| Behavior | |
![]() |
Modifies the given node renderer's position.
| Behavior | |
|
Modifies the given node renderer's velocity.
| VelocityReductionBehavior | ||
| Method | Defined by | ||
|---|---|---|---|
|
loadValuesFromXML(behaviorElem:XML):void
Updates this behavior with values from the given XML element.
| VelocityReductionBehavior | ||
| autoStart | property |
autoStart:Boolean [read-write]Indicates whether the timer should restart automatically when the graph changes. If true, the timer will restart when the Constellation dispatches the "change" event.
Implementation public function get autoStart():Boolean
public function set autoStart(value:Boolean):void
| constellation | property |
constellation:IConstellation [read-write]The constellation instance this behavior belongs to.
Implementation public function get constellation():IConstellation
public function set constellation(value:IConstellation):void
| delay | property |
delay:Number [read-write]The delay, in milliseconds, before starting to reduce the velocity. If you set the delay while the timer is running, the timer will restart.
Implementation public function get delay():Number
public function set delay(value:Number):void
| duration | property |
duration:Number [read-write]The length of time over which the velocity is reduced to zero. If you set the duration while the timer is running, the timer will restart.
Implementation public function get duration():Number
public function set duration(value:Number):void
| initialVelocityLimit | property |
initialVelocityLimit:Number [read-write]The initial velocity limit applied to each node renderer.
Implementation public function get initialVelocityLimit():Number
public function set initialVelocityLimit(value:Number):void
| VelocityReductionBehavior | () | constructor |
public function VelocityReductionBehavior(initialVelocityLimit:Number = 20, delay:Number = 5000, duration:Number = 1000, autoStart:Boolean = true, autoPause:Boolean = true)Creates a new velocity reduction behavior.
ParametersinitialVelocityLimit:Number (default = 20) |
|
delay:Number (default = 5000) |
|
duration:Number (default = 1000) |
|
autoStart:Boolean (default = true) |
|
autoPause:Boolean (default = true) |
| affectsVelocity | () | method |
public override function affectsVelocity():BooleanIndicates whether this class affects node renderers' velocity. This function must return true if this behavior affects velocity.
ReturnsBoolean |
| loadValuesFromXML | () | method |
protected override function loadValuesFromXML(behaviorElem:XML):voidUpdates this behavior with values from the given XML element. This method should be overridden to update this Behavior.
ParametersbehaviorElem:XML |
| reset | () | method |
public function reset():voidStops the delay countdown and resets the velocity limit to the initial value.
| restart | () | method |
public function restart():void
Equivalent to a call to reset() followed by start().
Resets the velocity limit to the initial value and starts the delay countdown.
| start | () | method |
public function start():voidStarts the delay countdown timer.
| stepStart | () | method |
public override function stepStart():voidMethod called at the beginning of a step.
| updateVelocity | () | method |
public override function updateVelocity(nodeRenderer:INodeRenderer):INodeRenderer
Modifies the given node renderer's velocity. This method will never be
called if affectsVelocity() doesn't return true. This
method should be overridden to affect the given node renderer's velocity.
nodeRenderer:INodeRenderer |
INodeRenderer |