Packagecom.yworks.graph.model
Classpublic class LayoutExecutor
InheritanceLayoutExecutor Inheritance Object

A helper class that can be used to execute a Layouter, and possibly animate the result.



Public Properties
 PropertyDefined By
  animateViewport : Boolean
Gets or sets a value indicating whether to animate the viewport.
LayoutExecutor
  configureTableNodeLayout : Boolean
Whether to automatically perform calls to TableLayoutConfigurator.prepareAll() and TableLayoutConfigurator.restoreAll() in order to layout table nodes.
LayoutExecutor
  duration : int
Gets or sets the duration of the animation.
LayoutExecutor
  easingFunction : Function
Gets or sets the easing function that should be used for the animation.
LayoutExecutor
  finishHandler : Function
Gets or sets the function that will be executed when this instance has finished its work.
LayoutExecutor
  graph : IGraph
[read-only] Gets the graph this instance is working on.
LayoutExecutor
  tableLayoutConfigurator : TableLayoutConfigurator
[read-only] The table layout configurator that is used if configureTableNodeLayout is enabled.
LayoutExecutor
  targetBoundsInsets : IRectangle
Gets or sets the target bounds insets that will be used to calculate the target viewport.
LayoutExecutor
  updateContentRect : Boolean
Gets or sets a value indicating whether the content rectangle property of the canvas should be updated upon completion.
LayoutExecutor
Protected Properties
 PropertyDefined By
  canvas : GraphCanvasComponent
[read-only] Gets the canvas this instance has been created for.
LayoutExecutor
Public Methods
 MethodDefined By
  
LayoutExecutor(canvas:GraphCanvasComponent, layouter:Layouter, graph:IGraph = null, duration:int = 0, handler:Function = null, animateViewPort:Boolean = false, easingFunction:Function = null, targetBoundsInsets:IRectangle = null, updateContentRect:Boolean = false)
Initializes a new instance of the LayoutExecutor class.
LayoutExecutor
  
start():void
Actually starts the process.
LayoutExecutor
Protected Methods
 MethodDefined By
  
Factory method that creates and configures the LayoutMorpherWrapper that will be used by this instance after the layout has been calculated.
LayoutExecutor
  
Create a new instance of TableLayoutConfigurator that is used if configureTableNodeLayout is enabled.
LayoutExecutor
  
Set up the TableLayoutConfigurator for an actual layout run.
LayoutExecutor
  
Writes the table layout information provided through TableLayoutConfigurator back to all tables.
LayoutExecutor
Property Detail
animateViewportproperty
animateViewport:Boolean

Gets or sets a value indicating whether to animate the viewport.

The default value is false.


Implementation
    public function get animateViewport():Boolean
    public function set animateViewport(value:Boolean):void
canvasproperty 
canvas:GraphCanvasComponent  [read-only]

Gets the canvas this instance has been created for.


Implementation
    protected function get canvas():GraphCanvasComponent
configureTableNodeLayoutproperty 
configureTableNodeLayout:Boolean

Whether to automatically perform calls to TableLayoutConfigurator.prepareAll() and TableLayoutConfigurator.restoreAll() in order to layout table nodes.

The default value is true.


Implementation
    public function get configureTableNodeLayout():Boolean
    public function set configureTableNodeLayout(value:Boolean):void
durationproperty 
duration:int

Gets or sets the duration of the animation.

A value smaller than 0 will prevent the animation from happening.

The default value is 0.


Implementation
    public function get duration():int
    public function set duration(value:int):void
easingFunctionproperty 
easingFunction:Function

Gets or sets the easing function that should be used for the animation.

The Flex framework provides multiple easing functions in the mx.effects.easing package.

The default mx.effects.easing.Linear#easeNone() function doesn't apply an easing effect at all.

The default value is mx.effects.easing.Linear#easeNone().


Implementation
    public function get easingFunction():Function
    public function set easingFunction(value:Function):void
finishHandlerproperty 
finishHandler:Function

Gets or sets the function that will be executed when this instance has finished its work.

The function that will be called upon completion or upon an exception.

The function must have the following signature: function( event:Event ):void

The default value is null.


Implementation
    public function get finishHandler():Function
    public function set finishHandler(value:Function):void
graphproperty 
graph:IGraph  [read-only]

Gets the graph this instance is working on.


Implementation
    public function get graph():IGraph
tableLayoutConfiguratorproperty 
tableLayoutConfigurator:TableLayoutConfigurator  [read-only]

The table layout configurator that is used if configureTableNodeLayout is enabled.

The TableLayoutConfigurator is created upon first access by createTableLayoutConfigurator().


Implementation
    public function get tableLayoutConfigurator():TableLayoutConfigurator

See also

targetBoundsInsetsproperty 
targetBoundsInsets:IRectangle

Gets or sets the target bounds insets that will be used to calculate the target viewport.

The default value is Zero insets.


Implementation
    public function get targetBoundsInsets():IRectangle
    public function set targetBoundsInsets(value:IRectangle):void
updateContentRectproperty 
updateContentRect:Boolean

Gets or sets a value indicating whether the content rectangle property of the canvas should be updated upon completion.

The default value is false.


Implementation
    public function get updateContentRect():Boolean
    public function set updateContentRect(value:Boolean):void
Constructor Detail
LayoutExecutor()Constructor
public function LayoutExecutor(canvas:GraphCanvasComponent, layouter:Layouter, graph:IGraph = null, duration:int = 0, handler:Function = null, animateViewPort:Boolean = false, easingFunction:Function = null, targetBoundsInsets:IRectangle = null, updateContentRect:Boolean = false)

Initializes a new instance of the LayoutExecutor class.

Parameters
canvas:GraphCanvasComponent — The control which will be animated.
 
layouter:Layouter — The layouter to use.
 
graph:IGraph (default = null) — The graph to layout. If null, the IGraph instance provided by the canvas' graph parameter will be used.
 
duration:int (default = 0) — The duration of the animation. If set to 0, the layout is not animated.
 
handler:Function (default = null) — The finishHandler, a function which is called after the layout is applied. If animation is enabled the function will be called after the animation is finished.
 
animateViewPort:Boolean (default = false) — Whether to animate the view port if the graph cannot be displayed in the current view port.
 
easingFunction:Function (default = null) — An easing function for the animation. If none is provided the animation is played linearly.
 
targetBoundsInsets:IRectangle (default = null) — Insets for the content rect after the layout. Default is 10,10,10,10.
 
updateContentRect:Boolean (default = false) — Whether to update the content rectangle after the layout
Method Detail
createMorpher()method
protected function createMorpher():LayoutMorpherWrapper

Factory method that creates and configures the LayoutMorpherWrapper that will be used by this instance after the layout has been calculated.

Returns
LayoutMorpherWrapper — The morpher to use after the layout.
createTableLayoutConfigurator()method 
protected function createTableLayoutConfigurator():TableLayoutConfigurator

Create a new instance of TableLayoutConfigurator that is used if configureTableNodeLayout is enabled.

This method is called upon first access to tableLayoutConfigurator.

Returns
TableLayoutConfigurator — A new instance of TableLayoutConfigurator.
prepareTableLayout()method 
protected function prepareTableLayout():void

Set up the TableLayoutConfigurator for an actual layout run.

This implementation configures TableLayoutConfigurator.horizontalLayout according to the CanonicMultiStageLayouter.layoutOrientation and calls TableLayoutConfigurator.prepareAll()

restoreTableLayout()method 
protected function restoreTableLayout():void

Writes the table layout information provided through TableLayoutConfigurator back to all tables.

This method is only called when the layout is not animated.

See also

start()method 
public function start():void

Actually starts the process.