Package | com.yworks.graph.model |
Class | public class GraphModelManager |
Inheritance | GraphModelManager Object |
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;
GraphCanvasComponent
has an instance of this type
built-in already.
See also
Property | Defined 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 |
Method | Defined By | ||
---|---|---|---|
Creates a manager instance for the given control. | GraphModelManager | ||
getCanvasObjects(item:IModelItem):Array
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 | ||
normalizeZOrders():void
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 | ||
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. | 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 |
Method | Defined 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 |
contentGroup | property |
contentGroup:ICanvasObjectGroup
[read-only] Gets the content group this manager instance uses to add visual representation of the graph to.
public function get contentGroup():ICanvasObjectGroup
drawEdgesBehindGroupedNodes | property |
drawEdgesBehindGroupedNodes:Boolean
Determines whether edges should be drawn behind nodes if a grouped graph is displayed.
The default value is false
.
public function get drawEdgesBehindGroupedNodes():Boolean
public function set drawEdgesBehindGroupedNodes(value:Boolean):void
See also
edgeGroup | property |
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.
public function get edgeGroup():ICanvasObjectGroup
See also
edgeLabelGroup | property |
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.
public function get edgeLabelGroup():ICanvasObjectGroup
See also
edgeLabelInstaller | property |
edgeLabelInstaller:LabelStyleInstaller
[read-only]
Gets the StyleInstaller instance used for installing
an ILabel
of an IEdge
into the canvas.
createEdgeLabelInstaller
will be called.
public function get edgeLabelInstaller():LabelStyleInstaller
edgeLayerPolicy | property |
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
.
public function get edgeLayerPolicy():EdgeLayerPolicy
public function set edgeLayerPolicy(value:EdgeLayerPolicy):void
See also
edgeStyleInstaller | property |
edgeStyleInstaller:EdgeStyleInstaller
[read-only]
Gets the StyleInstaller instance used for installing
an IEdge
into the canvas.
createEdgeStyleInstaller
will be called.
public function get edgeStyleInstaller():EdgeStyleInstaller
filteredHitTestIterator | property |
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.
public function get filteredHitTestIterator():IFilteredHitTestIterator
graph | property |
graph:IGraph
The graph which is managed by this manager.
public function get graph():IGraph
public function set graph(value:IGraph):void
hitTestIterator | property |
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.
public function get hitTestIterator():IHitTestIterator
labelLayerPolicy | property |
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
.
public function get labelLayerPolicy():LabelLayerPolicy
public function set labelLayerPolicy(value:LabelLayerPolicy):void
See also
nodeGroup | property |
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.
public function get nodeGroup():ICanvasObjectGroup
nodeLabelGroup | property |
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.
public function get nodeLabelGroup():ICanvasObjectGroup
See also
nodeLabelInstaller | property |
nodeLabelInstaller:LabelStyleInstaller
[read-only]
Gets the StyleInstaller instance used for installing
an ILabel
of an INode
into the canvas.
createNodeLabelInstaller
will be called.
public function get nodeLabelInstaller():LabelStyleInstaller
nodeStyleInstaller | property |
nodeStyleInstaller:NodeStyleInstaller
[read-only]
Gets the StyleInstaller instance used for installing
an INode
into the canvas.
createNodeStyleInstaller
will be called.
public function get nodeStyleInstaller():NodeStyleInstaller
portGroup | property |
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.
public function get portGroup():ICanvasObjectGroup
See also
portLayerPolicy | property |
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
.
public function get portLayerPolicy():PortLayerPolicy
public function set portLayerPolicy(value:PortLayerPolicy):void
See also
portStyleInstaller | property |
portStyleInstaller:PortStyleInstaller
[read-only]
Factory method for the PortStyleInstaller property. This method will be called
upon first access to the portStyleInstaller"
property.
public function get portStyleInstaller():PortStyleInstaller
useZOrderSupport | property |
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
.
public function get useZOrderSupport():Boolean
public function set useZOrderSupport(value:Boolean):void
See also
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.
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.
|
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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 |
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.
|
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.
|
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
|
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 IModelItem s 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 IModelItem
s in each
ICanvasObjectGroup
s 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 IModelItem s 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 IModelItem s 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 IModelItem s 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 IModelItem
s in each
ICanvasObjectGroup
s 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.
|