Packagecom.asterisq.constellation.behaviors
Classpublic class LayoutBehavior
InheritanceLayoutBehavior Inheritance Behavior Inheritance flash.events.EventDispatcher
SubclassesSpiralLayoutBehavior, SunflowerLayoutBehavior, TreeLayoutBehavior

Base class for static layout behaviors. These behaviors set the ITweenableNodeRenderer properties of each affected node renderer and rely on the interpolation behaviors to do the actual animating.

The validate method should be overridden to do the actual updating of the ITweenableNodeRenderer properties.

If autoInvalidate is set to true, the layout will be invalidated when the Constellation component dispatches the ConstellationEvent.CHANGE event.



Public Properties
 PropertyDefined by
  autoInvalidate : Boolean
Flag indicating whether to automatically invalidate when the renderers change.
LayoutBehavior
  constellation : IConstellation
The constellation instance this behavior belongs to.
LayoutBehavior
 Inheritedenabled : Boolean
Indicates whether this behavior is currently enabled.
Behavior
 InheritednodeRendererFilterFunction : Function
The function which determines the node renderers affected by this behavior.
Behavior
Public Methods
 MethodDefined by
  
Creates a new behavior.
LayoutBehavior
 Inherited
Indicates whether this class affects node renderers' acceleration.
Behavior
 Inherited
Determines whether this behavior affects the given node renderer.
Behavior
 Inherited
affectsPosition():Boolean
Indicates whether this class affects node renderers' position.
Behavior
 Inherited
affectsVelocity():Boolean
Indicates whether this class affects node renderers' velocity.
Behavior
 Inherited
fromXML(elem:XML):Behavior
[static] Creates an IBehavior instance and initializes it with the given XML data.
Behavior
  
invalidate():void
Invalidates the layout and causes a redraw during the next step.
LayoutBehavior
 Inherited
stepEnd():void
Method called at the end of a step.
Behavior
  
stepStart():void
Method called at the beginning of a step.
LayoutBehavior
 Inherited
Modifies the given node renderer's acceleration.
Behavior
 Inherited
Modifies the given node renderer's position.
Behavior
 Inherited
Modifies the given node renderer's velocity.
Behavior
  
validate():Boolean
The layout validation method.
LayoutBehavior
Protected Methods
 MethodDefined by
  
loadValuesFromXML(behaviorElem:XML):void
Updates this behavior with values from the given XML element.
LayoutBehavior
  
setNodeRendererTargetPosition(tnr:ITweenableNodeRenderer, origin:Point, targetPosition:Point, startTime:Number):void
Convenience function for setting the ITweenableNodeRenderer animation properties.
LayoutBehavior
Property detail
autoInvalidateproperty
autoInvalidate:Boolean  [read-write]

Flag indicating whether to automatically invalidate when the renderers change. If true, the ConstellationEvent.CHANGE event will cause this behavior to validate during the next step.

Implementation
    public function get autoInvalidate():Boolean
    public function set autoInvalidate(value:Boolean):void
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
Constructor detail
LayoutBehavior()constructor
public function LayoutBehavior()

Creates a new behavior.

Method detail
invalidate()method
public function invalidate():void

Invalidates the layout and causes a redraw during the next step.

loadValuesFromXML()method 
protected override 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
setNodeRendererTargetPosition()method 
protected function setNodeRendererTargetPosition(tnr:ITweenableNodeRenderer, origin:Point, targetPosition:Point, startTime:Number):void

Convenience function for setting the ITweenableNodeRenderer animation properties.

Parameters
tnr:ITweenableNodeRenderer
 
origin:Point
 
targetPosition:Point
 
startTime:Number
stepStart()method 
public override function stepStart():void

Method called at the beginning of a step.

validate()method 
public function validate():Boolean

The layout validation method. Returns true if validation was successful.

This method should be overridden to update the ITweenableNodeRenderer properties according to the layout algorithm.

Returns
Boolean