Packagecom.yworks.canvas
Classpublic class CanvasObjectDependencyManager
InheritanceCanvasObjectDependencyManager Inheritance Object

A manager that keeps track of dirty items that are to be repainted when only some of the canvas objects displayed in a CanvasComponent are dirty.

See also

com.yworks.canvas.CanvasComponent.treePartiallyDirty


Public Properties
 PropertyDefined By
  graph : IGraph
[write-only] Sets the graph that is managed by this instance.
CanvasObjectDependencyManager
  maxDirtyItems : uint
The maximal number of dirty items this manager keeps track of.
CanvasObjectDependencyManager
Public Methods
 MethodDefined By
  
Creates an instance that manages dirty canvas objects for the given CanvasComponent
CanvasObjectDependencyManager
  
addDependency(fromItem:Object, toItem:Object):void
Add a dependency from fromItem to toItem.
CanvasObjectDependencyManager
  
Invalidates all items that are contained in the current selection model of the GraphCanvasComponent and all items that depend on the selected items.
CanvasObjectDependencyManager
  
removeDependency(fromItem:Object, toItem:Object):void
CanvasObjectDependencyManager
  
reset():void
Reset the invalidation status.
CanvasObjectDependencyManager
  
setDirty(item:Object):void
Sets the dirty flag of the canvas objects that correspond to this model item.
CanvasObjectDependencyManager
  
Updates all items of the graph by calling onGraphStructureChanged for each item of the graph.
CanvasObjectDependencyManager
Protected Methods
 MethodDefined By
  
onCanvasGraphChanged(oldGraph:IGraph, newGraph:IGraph):void
Callback that is invoked when the graph property changes.
CanvasObjectDependencyManager
  
Callback that is invoked when the structure of the graph managed by this instance changes.
CanvasObjectDependencyManager
Property Detail
graphproperty
graph:IGraph  [write-only]

Sets the graph that is managed by this instance.


Implementation
    public function set graph(value:IGraph):void
maxDirtyItemsproperty 
maxDirtyItems:uint

The maximal number of dirty items this manager keeps track of. If this number is exceeded, all display objects will be repainted on the next paint event.

The default value is 60;.


Implementation
    public function get maxDirtyItems():uint
    public function set maxDirtyItems(value:uint):void
Constructor Detail
CanvasObjectDependencyManager()Constructor
public function CanvasObjectDependencyManager(canvas:CanvasComponent)

Creates an instance that manages dirty canvas objects for the given CanvasComponent

Parameters
canvas:CanvasComponent
Method Detail
addDependency()method
public function addDependency(fromItem:Object, toItem:Object):void

Add a dependency from fromItem to toItem. If fromItem is set dirty, the manager will set toItem dirty as well.

Parameters

fromItem:Object — An item that is represented in the canvas object tree by one or more ICanvasObjects.
 
toItem:Object — An item that is represented in the canvas object tree by one or more ICanvasObjects.

invalidateSelection()method 
public function invalidateSelection():void

Invalidates all items that are contained in the current selection model of the GraphCanvasComponent and all items that depend on the selected items.

onCanvasGraphChanged()method 
protected function onCanvasGraphChanged(oldGraph:IGraph, newGraph:IGraph):void

Callback that is invoked when the graph property changes.

Parameters

oldGraph:IGraph — the old value of the graph property.
 
newGraph:IGraph — the actual value of the graph property.

onGraphStructureChanged()method 
protected function onGraphStructureChanged(evt:GraphEvent):void

Callback that is invoked when the structure of the graph managed by this instance changes.

The default implementation adds dependencies for newly created graph items in order to invalidate all canvas objects that depend on the visual apparance of these items when they set dirty.

Parameters

evt:GraphEvent

See also

removeDependency()method 
public function removeDependency(fromItem:Object, toItem:Object):void

Parameters

fromItem:Object
 
toItem:Object

reset()method 
public function reset():void

Reset the invalidation status.

setDirty()method 
public function setDirty(item:Object):void

Sets the dirty flag of the canvas objects that correspond to this model item. In addition, all canvas objects that correspond to items that depend on the given item will be set dirty.

If no dependency information is found for the given item, the whole canvas object tree will be set dirty.

Parameters

item:Object — An item that is represented in the canvas object tree by one or more ICanvasObjects.

updateGraphItems()method 
public function updateGraphItems():void

Updates all items of the graph by calling onGraphStructureChanged for each item of the graph.