Packagecom.asterisq.constellation.behaviors
Classpublic class Behavior
InheritanceBehavior Inheritance flash.events.EventDispatcher
ImplementsIBehavior
SubclassesAccelerationLimitBehavior, AccelerationStatsBehavior, AgoraphobeBehavior, AutoCenteringBehavior, BasicKinematicsBehavior, BoundedKinematicsBehavior, BoundsAutoCenteringBehavior, CartesianInterpolationBehavior, DampingBehavior, DraggingBehavior, EdgeAttractionBehavior, EdgeWeightStatsBehavior, LayoutBehavior, NodeCenteringBehavior, PolarInterpolationBehavior, RingBehavior, VelocityLimitBehavior, VelocityReductionBehavior, VelocityStatsBehavior, ZeroAccelerationBehavior

The base class for a behavior used to affect the acceleration, velocity, and position of node renderers.



Public Properties
 PropertyDefined by
  constellation : IConstellation
The constellation instance this behavior belongs to.
Behavior
  enabled : Boolean
Indicates whether this behavior is currently enabled.
Behavior
  nodeRendererFilterFunction : Function
The function which determines the node renderers affected by this behavior.
Behavior
Public Methods
 MethodDefined by
  
Creates a new base behavior.
Behavior
  
Indicates whether this class affects node renderers' acceleration.
Behavior
  
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.
Behavior
  
fromXML(elem:XML):Behavior
[static] Creates an IBehavior instance and initializes it with the given XML data.
Behavior
  
stepEnd():void
Method called at the end of a step.
Behavior
  
stepStart():void
Method called at the beginning of a step.
Behavior
  
Modifies the given node renderer's acceleration.
Behavior
  
Modifies the given node renderer's position.
Behavior
  
Modifies the given node renderer's velocity.
Behavior
Protected Methods
 MethodDefined by
  
loadValuesFromXML(behaviorElem:XML):void
Updates this behavior with values from the given XML element.
Behavior
Property detail
constellationproperty
constellation:IConstellation  [read-write]

The constellation instance this behavior belongs to.

Implementation
    public function get constellation():IConstellation
    public function set constellation(value:IConstellation):void
enabledproperty 
enabled:Boolean  [read-write]

Indicates whether this behavior is currently enabled.

Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
nodeRendererFilterFunctionproperty 
nodeRendererFilterFunction:Function  [read-write]

The function which determines the node renderers affected by this behavior. The filter function should take an INodeRenderer as its only parameter and return true if the node is affected and false otherwise.

Implementation
    public function get nodeRendererFilterFunction():Function
    public function set nodeRendererFilterFunction(value:Function):void
Constructor detail
Behavior()constructor
public function Behavior()

Creates a new base behavior.

Method detail
affectsAcceleration()method
public function affectsAcceleration():Boolean

Indicates whether this class affects node renderers' acceleration. This function must return true if this behavior affects acceleration.

Returns
Boolean
affectsNodeRenderer()method 
public function affectsNodeRenderer(nr:INodeRenderer):Boolean

Determines whether this behavior affects the given node renderer.

Parameters
nr:INodeRenderer

Returns
Boolean
affectsPosition()method 
public function affectsPosition():Boolean

Indicates whether this class affects node renderers' position. This function must return true if this behavior affects position.

Returns
Boolean
affectsVelocity()method 
public function affectsVelocity():Boolean

Indicates whether this class affects node renderers' velocity. This function must return true if this behavior affects velocity.

Returns
Boolean
fromXML()method 
public static function fromXML(elem:XML):Behavior

Creates an IBehavior instance and initializes it with the given XML data. The particular IBehavior that is loaded depends on the value of the class_name attribute.

Parameters
elem:XML

Returns
Behavior
loadValuesFromXML()method 
protected function loadValuesFromXML(behaviorElem:XML):void

Updates this behavior with values from the given XML element. This method should be overridden to update this Behavior.

Parameters
behaviorElem:XML
stepEnd()method 
public function stepEnd():void

Method called at the end of a step.

stepStart()method 
public function stepStart():void

Method called at the beginning of a step.

updateAcceleration()method 
public function updateAcceleration(nodeRenderer:INodeRenderer):INodeRenderer

Modifies the given node renderer's acceleration. This method will never be called if affectsAcceleration() doesn't return true. This method should be overridden to affect the given node renderer's acceleration.

Parameters
nodeRenderer:INodeRenderer

Returns
INodeRenderer
updatePosition()method 
public function updatePosition(nodeRenderer:INodeRenderer):INodeRenderer

Modifies the given node renderer's position. This method will never be called if affectsPosition() doesn't return true. This method should be overridden to affect the given node renderer's position.

Parameters
nodeRenderer:INodeRenderer

Returns
INodeRenderer
updateVelocity()method 
public 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.

Parameters
nodeRenderer:INodeRenderer

Returns
INodeRenderer