Packagecom.yworks.graph.anim
Classpublic class GraphMorpher
InheritanceGraphMorpher Inheritance flash.events.EventDispatcher

Creates graph animations that morph a graph from its current layout to a new layout.



Public Properties
 PropertyDefined By
  duration : Number
[write-only] The duration of the animation in milliseconds.
GraphMorpher
  easingFunction : Function
[write-only] The easing function used for the animation tween.
GraphMorpher
  newBounds : IRectangle
[read-only] The new bounds of the graph.
GraphMorpher
  newViewPoint : Point
[write-only] The view point the graph should arrive at.
GraphMorpher
  newZoom : Number
[write-only] The target zoom value.
GraphMorpher
Public Methods
 MethodDefined By
  
GraphMorpher(graphCanvas:GraphCanvasComponent, newBounds:IRectangle, newViewPoint:Point = null, newZoom:Number = -1, localViewMode:Boolean = false)
Constructor.
GraphMorpher
  
addEdge(edge:IEdge, endBends:IBendList, endSourcePort:IPort, endTargetPort:IPort, callback:IChangeDummyEdgeAppearanceCallback = null):void
Add an edge that should be animated.
GraphMorpher
  
addNode(node:INode, targetLayout:IRectangle):void
Add a node that should be animated.
GraphMorpher
  
addReshapeable(reshapeable:IReshapeable, sourceLayout:IRectangle, targetLayout:IRectangle):void
Add an IReshapeable to the animation.
GraphMorpher
  
addStripe(stripe:IStripe, targetSize:Number):void
GraphMorpher
  
cleanBends():void
Removes extra bends which were inserted while morphing.
GraphMorpher
  
Returns the location the given node will be morphed to or null if this GraphMorpher doesn't know the given node.
GraphMorpher
  
play():void
Start the animation.
GraphMorpher
  
stop():void
Stops the animation, if it is currently running.
GraphMorpher
Events
 Event Summary Defined By
  Dispatched when the graph animation ended.GraphMorpher
Property Detail
durationproperty
duration:Number  [write-only]

The duration of the animation in milliseconds.

The default value is 500.


Implementation
    public function set duration(value:Number):void
easingFunctionproperty 
easingFunction:Function  [write-only]

The easing function used for the animation tween.


Implementation
    public function set easingFunction(value:Function):void

See also

mx.effects.Tween.easingFunction
newBoundsproperty 
newBounds:IRectangle  [read-only]

The new bounds of the graph.


Implementation
    public function get newBounds():IRectangle
newViewPointproperty 
newViewPoint:Point  [write-only]

The view point the graph should arrive at.


Implementation
    public function set newViewPoint(value:Point):void
newZoomproperty 
newZoom:Number  [write-only]

The target zoom value.


Implementation
    public function set newZoom(value:Number):void
Constructor Detail
GraphMorpher()Constructor
public function GraphMorpher(graphCanvas:GraphCanvasComponent, newBounds:IRectangle, newViewPoint:Point = null, newZoom:Number = -1, localViewMode:Boolean = false)

Constructor.

Parameters
graphCanvas:GraphCanvasComponent — The GraphCanvasComponent to work on.
 
newBounds:IRectangle — The new bounds of the graph.
 
newViewPoint:Point (default = null) — The target view point. If null, the view point of the graph will not change.
 
newZoom:Number (default = -1) — The target zoom level. If -1, the zoom level will not change.
 
localViewMode:Boolean (default = false)
Method Detail
addEdge()method
public function addEdge(edge:IEdge, endBends:IBendList, endSourcePort:IPort, endTargetPort:IPort, callback:IChangeDummyEdgeAppearanceCallback = null):void

Add an edge that should be animated.

Parameters

edge:IEdge — The edge to animated.
 
endBends:IBendList — The bends of the edge after the animation.
 
endSourcePort:IPort — The source port of the edge after the animation.
 
endTargetPort:IPort — The target port of the edge after the animation.
 
callback:IChangeDummyEdgeAppearanceCallback (default = null)

addNode()method 
public function addNode(node:INode, targetLayout:IRectangle):void

Add a node that should be animated.

Parameters

node:INode — The node to be animated.
 
targetLayout:IRectangle — The position and size the node should be animated to.

addReshapeable()method 
public function addReshapeable(reshapeable:IReshapeable, sourceLayout:IRectangle, targetLayout:IRectangle):void

Add an IReshapeable to the animation.

Parameters

reshapeable:IReshapeable — A reshapbeable that will be reshaped during the animation
 
sourceLayout:IRectangle — the layout at the beginning of the animation
 
targetLayout:IRectangle — the layout at the end of the animation

addStripe()method 
public function addStripe(stripe:IStripe, targetSize:Number):void

Parameters

stripe:IStripe
 
targetSize:Number

cleanBends()method 
public function cleanBends():void

Removes extra bends which were inserted while morphing.

getTargetNodeLocation()method 
public function getTargetNodeLocation(node:INode):IPoint

Returns the location the given node will be morphed to or null if this GraphMorpher doesn't know the given node.

Parameters

node:INode — the node which is queried.

Returns
IPoint — the node's location.
play()method 
public function play():void

Start the animation. When the animation has ended, a GraphMorphEvent is dispatched.

stop()method 
public function stop():void

Stops the animation, if it is currently running. This will trigger the GraphMorphEvent.MORPH_END event.

Event Detail
morphEnd Event
Event Object Type: com.yworks.graph.anim.GraphMorphEvent
GraphMorphEvent.type property = GraphMorphEvent.MORPH_END

Dispatched when the graph animation ended.