Packagecom.yworks.graph.model
Classpublic class GraphModelManager
InheritanceGraphModelManager Inheritance Object

Manages the visual appearance of an IGraph instance in a CanvasComponent.

This class monitors the structural changes of an IGraph implementation and installs the necessary ICanvasObject instances in the canvas for each item in the graph. The actual installation of the items is delegated to different IModelItemInstaller instances depending on the type of the item. The layer, model items are installed in, can be customized by different label and edge layer policies. If an IZOrderSupport is found in the set graph's lookup and the useZOrderSupport property is set to true, the provided z-orders are respected. Typically one would use instances of this class as follows:

     var manager:GraphModelManager = new GraphModelManager( canvasComponent );
     manager.graph = graph;
     
Note that GraphCanvasComponent has an instance of this type built-in already.

See also

com.yworks.graph.model.IZOrderSupport


Public Properties
 PropertyDefined By
  contentGroup : ICanvasObjectGroup
[read-only] Gets the content group this manager instance uses to add visual representation of the graph to.
GraphModelManager
  drawEdgesBehindGroupedNodes : Boolean
Deprecated: Please Use edgeLayerPolicy = EdgeLayerPolicy.BEHIND_GROUP_NODES
Determines whether edges should be drawn behind nodes if a grouped graph is displayed.
GraphModelManager
  edgeGroup : ICanvasObjectGroup
[read-only] Gets the ICanvasObjectGroup instance that will be used for installing edge styles if the edgeLayerPolicy EdgeLayerPolicy.SEPARATE_LAYER is set.
GraphModelManager
  edgeLabelGroup : ICanvasObjectGroup
[read-only] Gets the ICanvasObjectGroup instance that will be used for installing edge label styles if the labelLayerPolicy LabelLayerPolicy.SEPARATE_LAYER is set.
GraphModelManager
  edgeLabelInstaller : LabelStyleInstaller
[read-only] Gets the StyleInstaller instance used for installing an ILabel of an IEdge into the canvas. If the field has not yet been initialized upon first access, the factory method createEdgeLabelInstaller will be called.
GraphModelManager
  edgeLayerPolicy : EdgeLayerPolicy
The policy to decide at which visual layer edges shall be inserted.
GraphModelManager
  edgeStyleInstaller : EdgeStyleInstaller
[read-only] Gets the StyleInstaller instance used for installing an IEdge into the canvas. If the field has not yet been initialized upon first access, the factory method createEdgeStyleInstaller will be called.
GraphModelManager
  filteredHitTestIterator : IFilteredHitTestIterator
[read-only] Gets an IFilteredHitTestIterator that can be used to iterate hits on the canvas at a given world coordinate position and filter those hits by a given filter function.
GraphModelManager
  graph : IGraph
The graph which is managed by this manager.
GraphModelManager
  hitTestIterator : IHitTestIterator
[read-only] Gets an IHitTestIterator that can be used to iterate hits on the canvas at a given world coordinate position.
GraphModelManager
  labelLayerPolicy : LabelLayerPolicy
The policy to decide at which visual layer labels shall be inserted.
GraphModelManager
  nodeGroup : ICanvasObjectGroup
[read-only] Gets the ICanvasObjectGroup instance that will be used for installing node styles.
GraphModelManager
  nodeLabelGroup : ICanvasObjectGroup
[read-only] Gets the ICanvasObjectGroup instance that will be used for installing node label styles if the labelLayerPolicy LabelLayerPolicy.SEPARATE_LAYER is set.
GraphModelManager
  nodeLabelInstaller : LabelStyleInstaller
[read-only] Gets the StyleInstaller instance used for installing an ILabel of an INode into the canvas. If the field has not yet been initialized upon first access, the factory method createNodeLabelInstaller will be called.
GraphModelManager
  nodeStyleInstaller : NodeStyleInstaller
[read-only] Gets the StyleInstaller instance used for installing an INode into the canvas. If the field has not yet been initialized upon first access, the factory method createNodeStyleInstaller will be called.
GraphModelManager
  portGroup : ICanvasObjectGroup
[read-only] Gets the ICanvasObjectGroup instance that will be used for installing port styles if the portLayerPolicy PortLayerPolicy.SEPARATE_LAYER is set.
GraphModelManager
  portLayerPolicy : PortLayerPolicy
The policy to decide at which visual layer ports shall be inserted.
GraphModelManager
  portStyleInstaller : PortStyleInstaller
[read-only] Factory method for the PortStyleInstaller property.
GraphModelManager
  useZOrderSupport : Boolean
Gets or sets if this instance makes use of the IZOrderSupport found in the graph's lookup.
GraphModelManager
Public Methods
 MethodDefined By
  
Creates a manager instance for the given control.
GraphModelManager
  
Retrieves all canvas objects that have been registered for the given item or null.
GraphModelManager
  
Retrieves the Canvas Object group to use for the given edge.
GraphModelManager
  
Retrieves the main canvas object that has been registered for the given item or null.
GraphModelManager
  
Retrieves the main render canvas object that has been registered for the given item or null.
GraphModelManager
  
Retrieves the corresponding IModelItem for the given canvas object.
GraphModelManager
  
iterateHits(x:Number, y:Number, filter:Function = null):Iterator
Iterates hits on the canvas at a given world coordinate position.
GraphModelManager
  
lower(item:IModelItem):void
Moves the main render canvas object of the passed IModelItem one step closer to the beginning of the group rendering list, so that it will be painted behind of its current predecessor. This is done by setting appropriate z-orders via the IZOrderSupport of the set graph.
GraphModelManager
  
lowerSelection(selection:ISelectionModel = null):void
Moves the main render canvas objects of all selected model items one step closer to the beginning of the group rendering list, so that they will be painted behind their current unselected predecessors.
GraphModelManager
  
Uses the visual z-order of the model items to set normalized z-order indices using the IZOrderSupport of the set graph.
GraphModelManager
  
raise(item:IModelItem):void
Moves the main render canvas object of the passed IModelItem one step closer to the end of the group rendering list, so that it will be painted on top of its current successor. This is done by setting appropriate z-orders via the IZOrderSupport of the set graph.
GraphModelManager
  
raiseSelection(selection:ISelectionModel = null):void
Moves the main render canvas objects of all selected model items one step closer to the end of the group rendering list, so that they will be painted on top of their current unselected successors.
GraphModelManager
  
selectionToBack(selection:ISelectionModel = null):void
Moves the main render canvas objects of all selected model items to the beginning of the group rendering list, so that they will be painted behind all unselected items in the same group.
GraphModelManager
  
selectionToFront(selection:ISelectionModel = null):void
Moves the main render canvas objects of all selected model items to the end of the group rendering list, so that they will be painted in front of all unselected items in the same group.
GraphModelManager
  
Synchronizes the visual z-order of the model items with their z-order index provided by the IZOrderSupport of the set graph. More precisely the main render canvas objects of the IModelItems in each ICanvasObjectGroups are sorted increasingly (from back to front) by their mapped index. Note that this method may only be called if the useZOrderSupport property is true, otherwise an IllegalOperationError is thrown.
GraphModelManager
  
toBack(item:IModelItem):void
Moves the main render canvas object of the passed IModelItem to the beginning of the group rendering list, so that it will be painted behind all other items in the same group. This is done by setting appropriate z-orders via the IZOrderSupport of the set graph.
GraphModelManager
  
toFront(item:IModelItem):void
Moves the main render canvas object of the passed IModelItem to the end of the group rendering list, so that it will be painted in front of all other items in the same group. This is done by setting appropriate z-orders via the IZOrderSupport of the set graph.
GraphModelManager
Protected Methods
 MethodDefined By
  
Creates an ICanvasGroupProvider instance that returns for each edge queried an ICanvasObjectGroup that will be provided to the EdgeStyleInstaller for each edge to be installed.
GraphModelManager
  
Factory method for the edgeGroup property.
GraphModelManager
  
Creates an ICanvasGroupProvider instance that returns for each edge label queried an ICanvasObjectGroup that will be provided to the edgeLabelInstaller for each edge label to be installed.
GraphModelManager
  
Factory method for the edgeLabelGroup property.
GraphModelManager
  
Factory method for the edgeLabelInstaller property.
GraphModelManager
  
Factory method for the EdgeStyleInstaller property.
GraphModelManager
  
Creates an ICanvasGroupProvider instance that returns for each node queried an ICanvasObjectGroup that will be provided to the nodeStyleInstaller for each node to be installed.
GraphModelManager
  
Factory method for the nodeGroup property.
GraphModelManager
  
Creates an ICanvasGroupProvider instance that returns for each node label queried an ICanvasObjectGroup that will be provided to the NodeLabelInstaller for each node label to be installed.
GraphModelManager
  
Factory method for the nodeLabelGroup property.
GraphModelManager
  
Factory method for the NodeLabelInstaller property.
GraphModelManager
  
Factory method for the NodeStyleInstaller property.
GraphModelManager
  
Creates an ICanvasGroupProvider instance that returns for each port queried an ICanvasObjectGroup that will be provided to the portStyleInstaller for each port to be installed.
GraphModelManager
  
Factory method for the portGroup property.
GraphModelManager
  
Factory method for the portStyleInstaller property.
GraphModelManager
  
Retrieves the Canvas Object group to use for the given node.
GraphModelManager
  
Retrieves the canvas object group the given edge label shall be installed in depending on the set labelLayerPolicy.
GraphModelManager
  
Retrieves the canvas object group the given node label shall be installed in depending on the set labelLayerPolicy.
GraphModelManager
  
Retrieves the canvas object group the given port shall be installed in depending on the set portLayerPolicy.
GraphModelManager
Property Detail
contentGroupproperty
contentGroup:ICanvasObjectGroup  [read-only]

Gets the content group this manager instance uses to add visual representation of the graph to.


Implementation
    public function get contentGroup():ICanvasObjectGroup
drawEdgesBehindGroupedNodesproperty 
drawEdgesBehindGroupedNodes:Boolean
Deprecated: Please Use edgeLayerPolicy = EdgeLayerPolicy.BEHIND_GROUP_NODES

Determines whether edges should be drawn behind nodes if a grouped graph is displayed.

The default value is false.


Implementation
    public function get drawEdgesBehindGroupedNodes():Boolean
    public function set drawEdgesBehindGroupedNodes(value:Boolean):void

See also

edgeGroupproperty 
edgeGroup:ICanvasObjectGroup  [read-only]

Gets the ICanvasObjectGroup instance that will be used for installing edge styles if the edgeLayerPolicy EdgeLayerPolicy.SEPARATE_LAYER is set.

If the field has not yet been initialized upon first access, the factory method createEdgeGroup will be called.


Implementation
    public function get edgeGroup():ICanvasObjectGroup

See also

edgeLabelGroupproperty 
edgeLabelGroup:ICanvasObjectGroup  [read-only]

Gets the ICanvasObjectGroup instance that will be used for installing edge label styles if the labelLayerPolicy LabelLayerPolicy.SEPARATE_LAYER is set.

If the field has not yet been initialized upon first access, the factory method createEdgeLabelGroup will be called.


Implementation
    public function get edgeLabelGroup():ICanvasObjectGroup

See also

labelLayerPolicy
com.yworks.graph.model.LabelLayerPolicy.SEPARATE_LAYER
edgeLabelInstallerproperty 
edgeLabelInstaller:LabelStyleInstaller  [read-only]

Gets the StyleInstaller instance used for installing an ILabel of an IEdge into the canvas.

If the field has not yet been initialized upon first access, the factory method createEdgeLabelInstaller will be called.


Implementation
    public function get edgeLabelInstaller():LabelStyleInstaller
edgeLayerPolicyproperty 
edgeLayerPolicy:EdgeLayerPolicy

The policy to decide at which visual layer edges shall be inserted.

The default value is com.yworks.graph.model.EdgeLayerPolicy.SEPARATE_LAYER.


Implementation
    public function get edgeLayerPolicy():EdgeLayerPolicy
    public function set edgeLayerPolicy(value:EdgeLayerPolicy):void

See also

edgeStyleInstallerproperty 
edgeStyleInstaller:EdgeStyleInstaller  [read-only]

Gets the StyleInstaller instance used for installing an IEdge into the canvas.

If the field has not yet been initialized upon first access, the factory method createEdgeStyleInstaller will be called.


Implementation
    public function get edgeStyleInstaller():EdgeStyleInstaller
filteredHitTestIteratorproperty 
filteredHitTestIterator:IFilteredHitTestIterator  [read-only]

Gets an IFilteredHitTestIterator that can be used to iterate hits on the canvas at a given world coordinate position and filter those hits by a given filter function.

This iterator will iterate hits in the order so that the visually topmost element will be reported first.


Implementation
    public function get filteredHitTestIterator():IFilteredHitTestIterator
graphproperty 
graph:IGraph

The graph which is managed by this manager.


Implementation
    public function get graph():IGraph
    public function set graph(value:IGraph):void
hitTestIteratorproperty 
hitTestIterator:IHitTestIterator  [read-only]

Gets an IHitTestIterator that can be used to iterate hits on the canvas at a given world coordinate position.

This iterator will iterate hits in the order so that the visually topmost element will be reported first.


Implementation
    public function get hitTestIterator():IHitTestIterator
labelLayerPolicyproperty 
labelLayerPolicy:LabelLayerPolicy

The policy to decide at which visual layer labels shall be inserted.

The default value is com.yworks.graph.model.LabelLayerPolicy.AT_OWNER.


Implementation
    public function get labelLayerPolicy():LabelLayerPolicy
    public function set labelLayerPolicy(value:LabelLayerPolicy):void

See also

nodeGroupproperty 
nodeGroup:ICanvasObjectGroup  [read-only]

Gets the ICanvasObjectGroup instance that will be used for installing node styles.

If the field has not yet been initialized upon first access, the factory method createNodeGroup will be called.


Implementation
    public function get nodeGroup():ICanvasObjectGroup
nodeLabelGroupproperty 
nodeLabelGroup:ICanvasObjectGroup  [read-only]

Gets the ICanvasObjectGroup instance that will be used for installing node label styles if the labelLayerPolicy LabelLayerPolicy.SEPARATE_LAYER is set.

If the field has not yet been initialized upon first access, the factory method createNodeLabelGroup will be called.


Implementation
    public function get nodeLabelGroup():ICanvasObjectGroup

See also

nodeLabelInstallerproperty 
nodeLabelInstaller:LabelStyleInstaller  [read-only]

Gets the StyleInstaller instance used for installing an ILabel of an INode into the canvas.

If the field has not yet been initialized upon first access, the factory method createNodeLabelInstaller will be called.


Implementation
    public function get nodeLabelInstaller():LabelStyleInstaller
nodeStyleInstallerproperty 
nodeStyleInstaller:NodeStyleInstaller  [read-only]

Gets the StyleInstaller instance used for installing an INode into the canvas.

If the field has not yet been initialized upon first access, the factory method createNodeStyleInstaller will be called.


Implementation
    public function get nodeStyleInstaller():NodeStyleInstaller
portGroupproperty 
portGroup:ICanvasObjectGroup  [read-only]

Gets the ICanvasObjectGroup instance that will be used for installing port styles if the portLayerPolicy PortLayerPolicy.SEPARATE_LAYER is set.

If the field has not yet been initialized upon first access, the factory method createPortGroup will be called.


Implementation
    public function get portGroup():ICanvasObjectGroup

See also

portLayerPolicyproperty 
portLayerPolicy:PortLayerPolicy

The policy to decide at which visual layer ports shall be inserted.

The default value is com.yworks.graph.model.PortLayerPolicy.AT_OWNER.


Implementation
    public function get portLayerPolicy():PortLayerPolicy
    public function set portLayerPolicy(value:PortLayerPolicy):void

See also

portStyleInstallerproperty 
portStyleInstaller:PortStyleInstaller  [read-only]

Factory method for the PortStyleInstaller property. This method will be called upon first access to the portStyleInstaller" property.


Implementation
    public function get portStyleInstaller():PortStyleInstaller
useZOrderSupportproperty 
useZOrderSupport:Boolean

Gets or sets if this instance makes use of the IZOrderSupport found in the graph's lookup.

If true, model items placed in the same ICanvasObjectGroup are sorted by their z-order provided by the found IZOrderSupport.

Note that the following methods may only be called if this property is set to true:

After enabling z-order support you should either call synchronizeZOrders to adjust the visual z-orders to the values provided by the IZOrderSupport or normalizeZOrders to adjust the values in IZOrderSupport to reflect the current visual z-orders.

The default value is false.


Implementation
    public function get useZOrderSupport():Boolean
    public function set useZOrderSupport(value:Boolean):void

See also

Constructor Detail
GraphModelManager()Constructor
public function GraphModelManager(canvas:CanvasComponent, contentGroup:ICanvasObjectGroup)

Creates a manager instance for the given control. The contents of the graph will be added to given group which must be part of the canvas.

In order to get anything useful out of this instance the graph property should be set to an instance after construction.

Parameters
canvas:CanvasComponent — the canvas to manage the visual appearance of a graph for.
 
contentGroup:ICanvasObjectGroup — the group to add the graph's visual content to.
Method Detail
createEdgeCanvasGroupProvider()method
protected function createEdgeCanvasGroupProvider():ICanvasGroupProvider

Creates an ICanvasGroupProvider instance that returns for each edge queried an ICanvasObjectGroup that will be provided to the EdgeStyleInstaller for each edge to be installed.

Returns
ICanvasGroupProvider — A provider that respects the set edgeLayerPolicy.

See also

createEdgeGroup()method 
protected function createEdgeGroup():ICanvasObjectGroup

Factory method for the edgeGroup property. This method will be called upon first access to the edgeGroup property.

Returns
ICanvasObjectGroup — a new instance of ICanvasObjectGroup
createEdgeLabelCanvasGroupProvider()method 
protected function createEdgeLabelCanvasGroupProvider():ICanvasGroupProvider

Creates an ICanvasGroupProvider instance that returns for each edge label queried an ICanvasObjectGroup that will be provided to the edgeLabelInstaller for each edge label to be installed.

Returns
ICanvasGroupProvider — A provider that respects the set labelLayerPolicy.
createEdgeLabelGroup()method 
protected function createEdgeLabelGroup():ICanvasObjectGroup

Factory method for the edgeLabelGroup property. This method will be called upon first access to the edgeLabelGroup property.

Returns
ICanvasObjectGroup — a new instance of ICanvasObjectGroup
createEdgeLabelInstaller()method 
protected function createEdgeLabelInstaller():LabelStyleInstaller

Factory method for the edgeLabelInstaller property. This method will be called upon first access to the edgeLabelInstaller property.

Returns
LabelStyleInstaller — a new instance of LabelStyleInstaller
createEdgeStyleInstaller()method 
protected function createEdgeStyleInstaller():EdgeStyleInstaller

Factory method for the EdgeStyleInstaller property. This method will be called upon first access to the edgeStyleInstaller property.

Returns
EdgeStyleInstaller — A new instance of EdgeStyleInstaller
createNodeCanvasGroupProvider()method 
protected function createNodeCanvasGroupProvider():ICanvasGroupProvider

Creates an ICanvasGroupProvider instance that returns for each node queried an ICanvasObjectGroup that will be provided to the nodeStyleInstaller for each node to be installed.

Returns
ICanvasGroupProvider — A provider that returns the nodeGroup or a descendant canvas group for each node.
createNodeGroup()method 
protected function createNodeGroup():ICanvasObjectGroup

Factory method for the nodeGroup property. This method will be called upon first access to the NodeGroup property.

Returns
ICanvasObjectGroup — a new instance of ICanvasObjectGroup
createNodeLabelCanvasGroupProvider()method 
protected function createNodeLabelCanvasGroupProvider():ICanvasGroupProvider

Creates an ICanvasGroupProvider instance that returns for each node label queried an ICanvasObjectGroup that will be provided to the NodeLabelInstaller for each node label to be installed.

Returns
ICanvasGroupProvider — A provider that respects the set labelLayerPolicy.
createNodeLabelGroup()method 
protected function createNodeLabelGroup():ICanvasObjectGroup

Factory method for the nodeLabelGroup property. This method will be called upon first access to the nodeLabelGroup property.

Returns
ICanvasObjectGroup — a new instance of ICanvasObjectGroup
createNodeLabelInstaller()method 
protected function createNodeLabelInstaller():LabelStyleInstaller

Factory method for the NodeLabelInstaller property. This method will be called upon first access to the nodeLabelInstaller property.

Returns
LabelStyleInstaller — a new instance of LabelStyleInstaller
createNodeStyleInstaller()method 
protected function createNodeStyleInstaller():NodeStyleInstaller

Factory method for the NodeStyleInstaller property. This method will be called upon first access to the nodeStyleInstaller property.

Returns
NodeStyleInstaller
createPortCanvasGroupProvider()method 
protected function createPortCanvasGroupProvider():ICanvasGroupProvider

Creates an ICanvasGroupProvider instance that returns for each port queried an ICanvasObjectGroup that will be provided to the portStyleInstaller for each port to be installed.

Returns
ICanvasGroupProvider — A provider that respects the set portLayerPolicy.
createPortGroup()method 
protected function createPortGroup():ICanvasObjectGroup

Factory method for the portGroup property. This method will be called upon first access to the portGroup property.

Returns
ICanvasObjectGroup — a new instance of ICanvasObjectGroup
createPortStyleInstaller()method 
protected function createPortStyleInstaller():PortStyleInstaller

Factory method for the portStyleInstaller property. This method will be called upon first access to the portStyleInstaller property.

Returns
PortStyleInstaller — A new instance of PortStyleInstaller
getCanvasObjectGroup()method 
protected function getCanvasObjectGroup(canvas:CanvasComponent, node:INode):ICanvasObjectGroup

Retrieves the Canvas Object group to use for the given node.

This implementation is called by the default instance that is created by createNodeCanvasGroupProvider

Parameters

canvas:CanvasComponent — The canvas to return the a group for.
 
node:INode — The node that will be installed in the canvas.

Returns
ICanvasObjectGroup — The group to use.

See also

getCanvasObjects()method 
public function getCanvasObjects(item:IModelItem):Array

Retrieves all canvas objects that have been registered for the given item or null.

Parameters

item:IModelItem — The item to retrieve the canvas objects for.

Returns
Array — An array of canvas object instances or null.
getEdgeCanvasObjectGroup()method 
public function getEdgeCanvasObjectGroup(canvas:CanvasComponent, edge:IEdge):ICanvasObjectGroup

Retrieves the Canvas Object group to use for the given edge.

This implementation is called by the default instance that is assigned to createEdgeCanvasGroupProvider()

Parameters

canvas:CanvasComponent — The canvas to return the group for.
 
edge:IEdge — The edge that will be installed in the canvas.

Returns
ICanvasObjectGroup — The group to use.

See also

getEdgeLabelCanvasObjectGroup()method 
protected function getEdgeLabelCanvasObjectGroup(canvas:CanvasComponent, label:ILabel):ICanvasObjectGroup

Retrieves the canvas object group the given edge label shall be installed in depending on the set labelLayerPolicy.

Parameters

canvas:CanvasComponent
 
label:ILabel — The label to get the canvas object group for.

Returns
ICanvasObjectGroup — The canvas object group to install the given label in.
getMainCanvasObject()method 
public function getMainCanvasObject(item:IModelItem):ICanvasObject

Retrieves the main canvas object that has been registered for the given item or null.

This implementation treats the first element in the array of canvas objects installed into the canvas for the item as the main object.

Parameters

item:IModelItem — The item to retrieve "the" canvas object for.

Returns
ICanvasObject — A canvas object instance or null.
getMainRenderCanvasObject()method 
public function getMainRenderCanvasObject(item:IModelItem):ICanvasObject

Retrieves the main render canvas object that has been registered for the given item or null.

The main render canvas object of an IModelItem represents the root of the subtree of the canvas object tree that contains the main canvas objects as well of the model item as of all model items whose rendering depends on this item.

This might be the main canvas object of the item itself (if no other item rendering depends on it) or an ICanvasObjectGroup (e.g. for a group nodes whose children depends on its rendering).

Parameters

item:IModelItem — The model item to get the main render canvas object for.

Returns
ICanvasObject — The main render canvas object that has been registered for the given item or null.
getModelItem()method 
public function getModelItem(canvasObject:ICanvasObject):IModelItem

Retrieves the corresponding IModelItem for the given canvas object.

Parameters

canvasObject:ICanvasObject

Returns
IModelItem
getNodeLabelCanvasObjectGroup()method 
protected function getNodeLabelCanvasObjectGroup(canvas:CanvasComponent, label:ILabel):ICanvasObjectGroup

Retrieves the canvas object group the given node label shall be installed in depending on the set labelLayerPolicy.

Parameters

canvas:CanvasComponent
 
label:ILabel — The label to get the canvas object group for.

Returns
ICanvasObjectGroup — The canvas object group to install the given label in.
getPortCanvasObjectGroup()method 
protected function getPortCanvasObjectGroup(canvas:CanvasComponent, port:IPort):ICanvasObjectGroup

Retrieves the canvas object group the given port shall be installed in depending on the set portLayerPolicy.

Parameters

canvas:CanvasComponent
 
port:IPort — The port to get the canvas object group for.

Returns
ICanvasObjectGroup — The canvas object group to install the given port in.
iterateHits()method 
public function iterateHits(x:Number, y:Number, filter:Function = null):Iterator

Iterates hits on the canvas at a given world coordinate position. Only if the given filter function returns true for a hit ICanvasObject, it is included in the iterator.

The instance returned will enumerate hits in the order so that the topmost visual element will be reported first.

Parameters

x:Number — the x world coordinate to perform the hit test
 
y:Number — the y world coordinate to perform the hit test
 
filter:Function (default = null) — a filter function applied to the ICanvasObjects

Returns
Iterator — An iterator that will enumerate the hits at the given coordinates
lower()method 
public function lower(item:IModelItem):void

Moves the main render canvas object of the passed IModelItem one step closer to the beginning of the group rendering list, so that it will be painted behind of its current predecessor. This is done by setting appropriate z-orders via the IZOrderSupport of the set graph.

Note that this method may only be called if the useZOrderSupport property is true, otherwise an IllegalOperationError is thrown.

Parameters

item:IModelItem — The model item to lower.

lowerSelection()method 
public function lowerSelection(selection:ISelectionModel = null):void

Moves the main render canvas objects of all selected model items one step closer to the beginning of the group rendering list, so that they will be painted behind their current unselected predecessors.

This is done by setting appropriate z-orders via the IZOrderSupport of the set graph.

Note that this method may only be called if the useZOrderSupport property is true, otherwise an IllegalOperationError is thrown.

Parameters

selection:ISelectionModel (default = null) — A selection of IModelItems that shall be lowered. If no selection is passed, the ISelectionModel in the lookup of the CanvasComponent this model manager works on is used.

normalizeZOrders()method 
public function normalizeZOrders():void

Uses the visual z-order of the model items to set normalized z-order indices using the IZOrderSupport of the set graph.

More precisely the main render canvas objects of the IModelItems in each ICanvasObjectGroups are numbered increasingly from back to front and starting by 0. A canvas object's number ist then set as the model item's z-order.

Note that this method may only be called if the useZOrderSupport property is true, otherwise an IllegalOperationError is thrown.

raise()method 
public function raise(item:IModelItem):void

Moves the main render canvas object of the passed IModelItem one step closer to the end of the group rendering list, so that it will be painted on top of its current successor. This is done by setting appropriate z-orders via the IZOrderSupport of the set graph.

Note that this method may only be called if the useZOrderSupport property is true, otherwise an IllegalOperationError is thrown.

Parameters

item:IModelItem — The model item to raise.

raiseSelection()method 
public function raiseSelection(selection:ISelectionModel = null):void

Moves the main render canvas objects of all selected model items one step closer to the end of the group rendering list, so that they will be painted on top of their current unselected successors.

This is done by setting appropriate z-orders via the IZOrderSupport of the set graph.

Note that this method may only be called if the useZOrderSupport property is true, otherwise an IllegalOperationError is thrown.

Parameters

selection:ISelectionModel (default = null) — A selection of IModelItems that shall be raised. If no selection is passed, the ISelectionModel in the lookup of the CanvasComponent this model manager works on is used.

selectionToBack()method 
public function selectionToBack(selection:ISelectionModel = null):void

Moves the main render canvas objects of all selected model items to the beginning of the group rendering list, so that they will be painted behind all unselected items in the same group.

This is done by setting appropriate z-orders via the IZOrderSupport of the set graph.

Note that this method may only be called if the useZOrderSupport property is true, otherwise an IllegalOperationError is thrown.

Parameters

selection:ISelectionModel (default = null) — A selection of IModelItems that shall moved to the back. If no selection is passed, the ISelectionModel in the lookup of the CanvasComponent this model manager works on is used.

selectionToFront()method 
public function selectionToFront(selection:ISelectionModel = null):void

Moves the main render canvas objects of all selected model items to the end of the group rendering list, so that they will be painted in front of all unselected items in the same group.

This is done by setting appropriate z-orders via the IZOrderSupport of the set graph.

Note that this method may only be called if the useZOrderSupport property is true, otherwise an IllegalOperationError is thrown.

Parameters

selection:ISelectionModel (default = null) — A selection of IModelItems that shall moved to the front. If no selection is passed, the ISelectionModel in the lookup of the CanvasComponent this model manager works on is used.

synchronizeZOrders()method 
public function synchronizeZOrders():void

Synchronizes the visual z-order of the model items with their z-order index provided by the IZOrderSupport of the set graph.

More precisely the main render canvas objects of the IModelItems in each ICanvasObjectGroups are sorted increasingly (from back to front) by their mapped index.

Note that this method may only be called if the useZOrderSupport property is true, otherwise an IllegalOperationError is thrown.

See also

toBack()method 
public function toBack(item:IModelItem):void

Moves the main render canvas object of the passed IModelItem to the beginning of the group rendering list, so that it will be painted behind all other items in the same group. This is done by setting appropriate z-orders via the IZOrderSupport of the set graph.

Note that this method may only be called if the useZOrderSupport property is true, otherwise an IllegalOperationError is thrown.

Parameters

item:IModelItem — The model item to move to the back.

toFront()method 
public function toFront(item:IModelItem):void

Moves the main render canvas object of the passed IModelItem to the end of the group rendering list, so that it will be painted in front of all other items in the same group. This is done by setting appropriate z-orders via the IZOrderSupport of the set graph.

Note that this method may only be called if the useZOrderSupport property is true, otherwise an IllegalOperationError is thrown.

Parameters

item:IModelItem — The model item to move to the front.