| 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.
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.
| 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
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. | GraphModelManager | ||
| edgeLabelGroup : ICanvasObjectGroup [read-only]
Gets the ICanvasObjectGroup instance that will be used for installing edge label styles. | 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 | ||
| 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
Gets or sets the graph this manager manages. | 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 | ||
| 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. | 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. | GraphModelManager | ||
| portStyleInstaller : PortStyleInstaller [read-only]
Factory method for the PortStyleInstaller property. | GraphModelManager | ||
| Method | Defined By | ||
|---|---|---|---|
Creates a manager instance for the given control. | GraphModelManager | ||
addShield():void
Adds a "shield" to each canvas object group. | 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 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 | ||
removeShield():void
Removes the "shield" from the canvas object groups. | 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 | ||
| 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:BooleanDetermines 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| edgeGroup | property |
edgeGroup:ICanvasObjectGroup [read-only] Gets the ICanvasObjectGroup instance that will be used for installing edge styles.
If the field has not yet been initialized upon first access, the factory method
createEdgeGroup will be called.
public function get edgeGroup():ICanvasObjectGroup| edgeLabelGroup | property |
edgeLabelGroup:ICanvasObjectGroup [read-only]
Gets the ICanvasObjectGroup instance that will be used for installing edge label styles.
If the field has not yet been initialized upon first access, the factory method
createEdgeLabelGroup will be called.
public function get edgeLabelGroup():ICanvasObjectGroup| 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| edgeManager | property |
edgeManager:CollectionModelManager [read-only] yworks_internal function get edgeManager():CollectionModelManager| 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:IGraphGets or sets the graph this manager manages.
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| 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 field has not yet been initialized upon first access, the factory method
createNodeLabelGroup will be called.
public function get nodeLabelGroup():ICanvasObjectGroup| 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| nodeManager | property |
nodeManager:CollectionModelManager [read-only] yworks_internal function get nodeManager():CollectionModelManager| 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 field has not yet been initialized upon first access, the factory method
createPortGroup will be called.
public function get portGroup():ICanvasObjectGroup| 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| 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 that is 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.
|
| addShield | () | method |
public function addShield():voidAdds a "shield" to each canvas object group. A shield is a (transparent) sprite which is laid over the display area.
Mouse Hovering over a Sprite with a large number of children seriously increases the Flash Player's CPU usage. When the mouse hovers over a child of that sprite, the CPU usage goes back to zero.
The "shield" ensures that the mouse is always hovering over a child sprite.
By default, the "shields" are already added to the canvas object groups| 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 constant provider that returns the edgeGroup
|
| 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 constant provider that returns the edgeLabelGroup
|
| 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 constant provider that returns the nodeGroup
|
| 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 constant provider that returns the nodeLabelGroup
|
| 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 constant provider that returns the portGroup
|
| 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):ICanvasObjectGroupRetrieves the Canvas Object group to use for the given node.
This implementation is called by the default instance that
is assigned to 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):ICanvasObjectGroupRetrieves 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 a group for.
| |
edge:IEdge — The edge that will be installed in the canvas.
|
ICanvasObjectGroup — The group to use.
|
See also
| 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.
|
| getModelItem | () | method |
public function getModelItem(canvasObject:ICanvasObject):IModelItem
Retrieves the corresponding IModelItem for
the given canvas object.
Parameters
canvasObject:ICanvasObject |
IModelItem |
| internal_getCanvasObjectGroup | () | method |
yworks_internal function internal_getCanvasObjectGroup(canvas:CanvasComponent, node:INode):ICanvasObjectGroupParameters
canvas:CanvasComponent | |
node:INode |
ICanvasObjectGroup |
| 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
|
| removeShield | () | method |
public function removeShield():voidRemoves the "shield" from the canvas object groups. A shield is a (transparent) sprite which is laid over the display area to work around Flash Player's performance issues.
If one uses UIComponets like buttons and set them, or the canvas object group they belong to, to the back, they may be hidden by the "shield", i.e. no longer acessible.
This method removes the "shield", so such components will be accessible.
See also