Remarks
This class monitors the structural changes of an IGraph implementation and installs the necessary IRenderTreeElement instance in the canvas for each item in the graph. Note that GraphComponent already has an instance of this type built-in, and usually it is not necessary to create your own.
This class will also use the node hierarchy to nest the nodes and edges accordingly and respect the nodeLabelLayerPolicy, edgeLabelLayerPolicy, portLabelLayerPolicy, and portLayerPolicy settings.
See Also
Developer's Guide
API
- nodeGroup, hierarchicalNestingPolicy, LabelLayerPolicy, PortLayerPolicy
Members
Constructors
Note that a properly configured instance is already set by default to a GraphComponent's graphModelManager property.
If a new instance of this is set to a GraphComponent's graphModelManager property, method install will be called automatically.
If this instance is not set via the graphModelManager property, it is important that the install life-cycle methods are called.
Properties
Gets the currently installed in CanvasComponent.
Gets the content group this manager instance uses to add visual representation of the graph to.
Gets the IRenderTreeGroup 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.
Note that in the case of hierarchically nested graphs, the main render tree elements of edges will only be put directly in this IRenderTreeGroup, if the property is not set to NODES_AND_EDGES. Otherwise, they will actually be nested in the subtree of the nodeGroup according to the node nesting.
See Also
Developer's Guide
API
- getEdgeRenderTreeGroup, edgeRenderer
Gets the IRenderTreeGroup instance that will be used for installing edge label styles.
See Also
Developer's Guide
API
- getLabelRenderTreeGroup, edgeLabelRenderer
Gets or sets the policy to determine at which visual layer edge labels shall be inserted.
Provides access to the ItemModelManager<T> which handles the ILabels at edges.
Gets or sets the IObjectRenderer<ILabel> instance used for installing an ILabel of an IEdge into the canvas.
Provides access to the ItemModelManager<T> which handles the IEdges.
Gets or sets the IObjectRenderer<IEdge> instance used for installing an IEdge into the canvas.
Gets or sets the graph this manager manages.
Gets the IRenderTreeGroup instance that will be used for installing node styles of group nodes.
See Also
Developer's Guide
API
- getNodeRenderTreeGroup, nodeRenderer, hierarchicalNestingPolicy
Gets or sets the policy whether and how this instance should nest the nodes and edges if the graph is grouped.
Gets a IHitTester that can be used to enumerate hits on the canvas at a given world coordinate position.
Gets the IRenderTreeGroup 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.
Note that the content of this group depends on the hierarchicalNestingPolicy:
- NONE – Contains the main render tree elements of all nodes top-level.
- NODES – Contains the main render tree elements of all nodes in a more complicated nesting of dynamically created IRenderTreeGroups.
- NODES_AND_EDGES – Contains the main render tree elements of all nodes and edges in a more complicated nesting of dynamically created IRenderTreeGroup s.
- GROUP_NODES – Contains the main render tree elements of all leaf nodes. Group nodes having the same hierarchical depth are in one child IRenderTreeGroup of the groupNodeGroup instead.
See Also
Developer's Guide
API
- getNodeRenderTreeGroup, getMainRenderTreeElement, nodeRenderer
Gets the IRenderTreeGroup instance that will be used for installing node label styles.
See Also
Developer's Guide
API
- getLabelRenderTreeGroup, nodeLabelRenderer
Gets or sets the policy to determine at which visual layer node labels shall be inserted.
Provides access to the ItemModelManager<T> which handles the ILabels at nodes.
Gets or sets the IObjectRenderer<ILabel> instance used for installing an ILabel of an INode into the canvas.
Provides access to the ItemModelManager<T> which handles the INodes.
Gets or sets the IObjectRenderer<INode> instance used for installing an INode into the canvas.
Gets the IRenderTreeGroup instance that will be used for installing port styles.
See Also
Developer's Guide
API
- getPortRenderTreeGroup, portRenderer
Gets the IRenderTreeGroup instance that will be used for installing port label styles.
See Also
Developer's Guide
API
- getLabelRenderTreeGroup, portLabelRenderer
Gets or sets the policy to determine at which visual layer port labels shall be inserted.
Provides access to the ItemModelManager<T> which handles the ILabels at ports.
Gets or sets the IObjectRenderer<ILabel> instance used for installing an ILabel of an IPort into the canvas.
Gets or sets the policy to determine at which visual layer node and edge ports shall be inserted.
Provides access to the ItemModelManager<T> which handles the IPorts.
Gets or sets the IObjectRenderer<IPort> instance used for installing an IPort into the canvas.
Gets an comparison instance that can be used to compare two model items with respect to their visual display order.
Methods
Compares two items with respect to their rendering order.
Parameters
- item1: IModelItem
- the first item to compare
- item2: IModelItem
- the second item to compare
Return Value
- number
- 0 if item1 == item2, > 0 if item1 is rendered behind item2, < 0 if item1 is rendered in front of item2. Items that are not part of the visualization are always considered to be rendered first.
See Also
Factory method for the edgeGroup property.
Return Value
- IRenderTreeGroup
- a new group that has been added to the contentGroup
Factory method for the edgeLabelGroup property.
Return Value
- IRenderTreeGroup
- a new group that has been added to the contentGroup
createEdgeLabelModelManager
(renderer: IObjectRenderer<ILabel>, callback: function(ILabel): IRenderTreeGroup): ItemModelManager<ILabel>protectedFactory method for creating the ItemModelManager<T> that handles the visual representation of edge labels.
createEdgeLabelModelManager
(renderer: IObjectRenderer<ILabel>, callback: function(ILabel): IRenderTreeGroup): ItemModelManager<ILabel>Parameters
- renderer: IObjectRenderer<ILabel>
- An IObjectRenderer<ILabel> for edge labels.
- callback: function(ILabel): IRenderTreeGroup
- A callback to get the IRenderTreeGroup containing the render tree element of a given edge label.
Return Value
- ItemModelManager<ILabel>
- a new instance of ItemModelManager<T> for edge labels
createEdgeModelManager
(renderer: IObjectRenderer<IEdge>, callback: function(IEdge): IRenderTreeGroup): ItemModelManager<IEdge>protectedFactory method for creating the ItemModelManager<T> that handles the visual representation of edges.
createEdgeModelManager
(renderer: IObjectRenderer<IEdge>, callback: function(IEdge): IRenderTreeGroup): ItemModelManager<IEdge>Parameters
- renderer: IObjectRenderer<IEdge>
- An IObjectRenderer<IEdge> for IEdges.
- callback: function(IEdge): IRenderTreeGroup
- A callback to get the IRenderTreeGroup containing the render tree element of a given edge.
Return Value
- ItemModelManager<IEdge>
- a new instance of ItemModelManager<T> for edges
Factory method for the groupNodeGroup property.
Return Value
- IRenderTreeGroup
- a new group that has been added to the contentGroup
Factory method for the nodeGroup property.
Return Value
- IRenderTreeGroup
- a new group that has been added to the contentGroup
Factory method for the nodeLabelGroup property.
Return Value
- IRenderTreeGroup
- a new group that has been added to the contentGroup
createNodeLabelModelManager
(renderer: IObjectRenderer<ILabel>, callback: function(ILabel): IRenderTreeGroup): ItemModelManager<ILabel>protectedFactory method for creating the ItemModelManager<T> that handles the visual representation of node labels.
createNodeLabelModelManager
(renderer: IObjectRenderer<ILabel>, callback: function(ILabel): IRenderTreeGroup): ItemModelManager<ILabel>Parameters
- renderer: IObjectRenderer<ILabel>
- An IObjectRenderer<ILabel> for node labels.
- callback: function(ILabel): IRenderTreeGroup
- A callback to get the IRenderTreeGroup containing the render tree element of a given node label.
Return Value
- ItemModelManager<ILabel>
- a new instance of ItemModelManager<T> for node labels
createNodeModelManager
(renderer: IObjectRenderer<INode>, callback: function(INode): IRenderTreeGroup): ItemModelManager<INode>protectedFactory method for creating the ItemModelManager<T> that handles the visual representation of nodes.
createNodeModelManager
(renderer: IObjectRenderer<INode>, callback: function(INode): IRenderTreeGroup): ItemModelManager<INode>Parameters
- renderer: IObjectRenderer<INode>
- An IObjectRenderer<INode> for INodes.
- callback: function(INode): IRenderTreeGroup
- A callback to get the IRenderTreeGroup containing the render tree element of a given node.
Return Value
- ItemModelManager<INode>
- a new instance of ItemModelManager<T> for nodes
Factory method for the portGroup property.
Return Value
- IRenderTreeGroup
- a new group that has been added to the contentGroup
Factory method for the portLabelGroup property.
Return Value
- IRenderTreeGroup
- a new group that has been added to the contentGroup
createPortLabelModelManager
(renderer: IObjectRenderer<ILabel>, callback: function(ILabel): IRenderTreeGroup): ItemModelManager<ILabel>protectedFactory method for creating the ItemModelManager<T> that handles the visual representation of port labels.
createPortLabelModelManager
(renderer: IObjectRenderer<ILabel>, callback: function(ILabel): IRenderTreeGroup): ItemModelManager<ILabel>Parameters
- renderer: IObjectRenderer<ILabel>
- An IObjectRenderer<ILabel> for port labels.
- callback: function(ILabel): IRenderTreeGroup
- A callback to get the IRenderTreeGroup containing the render tree element of a given port label.
Return Value
- ItemModelManager<ILabel>
- a new instance of ItemModelManager<T> for port labels
createPortModelManager
(renderer: IObjectRenderer<IPort>, callback: function(IPort): IRenderTreeGroup): ItemModelManager<IPort>protectedFactory method for creating the ItemModelManager<T> that handles the visual representation of ports.
createPortModelManager
(renderer: IObjectRenderer<IPort>, callback: function(IPort): IRenderTreeGroup): ItemModelManager<IPort>Parameters
- renderer: IObjectRenderer<IPort>
- An IObjectRenderer<IPort> for IPorts.
- callback: function(IPort): IRenderTreeGroup
- A callback to get the IRenderTreeGroup containing the render tree element of a given port.
Return Value
- ItemModelManager<IPort>
- a new instance of ItemModelManager<T> for ports
Retrieves the IRenderTreeGroup containing the render tree element of a given edge.
Parameters
- edge: IEdge
- The edge that will be installed in the canvas.
Return Value
- IRenderTreeGroup
- The group to use.
Retrieves the IRenderTreeGroup containing the render tree element of a given label.
Parameters
- label: ILabel
- The label that will be installed in the canvas.
Return Value
- IRenderTreeGroup
- The group to use.
Retrieves the IRenderTreeElement for a given model item that can be used for z-order or visibility operations.
The z-order can be changed on the returned IRenderTreeElement via raise, lower, toFront, toBack, above or below.
The visibility can be changed via the visible property.
Note that these z-order or visibility changes will also affect model items whose z-order directly depends on item like labels if AT_OWNER is chosen.
Parameters
- item: IModelItem
- the item
Return Value
- IRenderTreeElement
- The main render tree element for the given item or
null
See Also
Developer's Guide
API
- getRenderTreeElement
Retrieves the corresponding IModelItem for the given render tree element.
Parameters
- renderTreeElement: IRenderTreeElement
- The instance to use for the query
Return Value
- IModelItem
- The item that is associated with the render tree element or
null.
Retrieves the IRenderTreeGroup containing the render tree element of a given node.
Parameters
- node: INode
- The node that will be installed in the canvas.
Return Value
- IRenderTreeGroup
- The group to use.
See Also
Developer's Guide
Retrieves the IRenderTreeGroup containing the render tree element of a given port.
Parameters
- port: IPort
- The port that will be installed in the canvas.
Return Value
- IRenderTreeGroup
- The group to use.
Retrieves the IRenderTreeElement visualizing a given model item managed by this instance.
Parameters
- item: IModelItem
- the item
Return Value
- IRenderTreeElement
- the render tree element for the given item or
null
See Also
Enumerates hits in the render tree of the canvas at a given world coordinate position for a given context and IRenderTreeGroup.
The instance returned will enumerate hits in the order so that the topmost visual element will be reported first. The enumeration is performed lazily.
Note that if you do not specify the root parameter, only the members of the contentGroup will be hit tested.
Parameters
- location: Point
- the world coordinates to perform the hit test at
- context?: IInputModeContext
- The context to provide to isHit
- root?: IRenderTreeGroup
- The group to search the subtree of. contentGroup if not specified.
- typeFilter?: GraphItemTypes
- An optional filter that preselects a subset of types that will be tested and reported. This can result in improved performance when testing does not need to be performed.
Return Value
- IEnumerable<IModelItem>
- a live enumerable that will enumerate the hits at the given coordinates
Overridden in
WebGLGraphModelManager.hitElementsAtInstalls this instance for the specified CanvasComponent.
Parameters
- canvasComponent: CanvasComponent
- The CanvasComponent.
- graph: IGraph
- The graph.
- contentGroup?: IRenderTreeGroup
- The group to add the graph's visual content to. If omitted, the contentGroup of the renderTree of the
canvasComponentis used.
Overridden in
WebGLGraphModelManager.installLowers the visual representation of the item below its current predecessor.
item below its current predecessor.item below its current predecessor in its containing parent.Parameters
- item: IModelItem
- The model item to lower.
See Also
Developer's Guide
Lowers the visual representations of all IModelItems in items below their current predecessors.
items below their current predecessors.items below their current predecessors in their containing parent.Parameters
- items: IEnumerable<IModelItem>
- The IModelItems to lower.
See Also
Developer's Guide
Parameters
Overridden in
WebGLGraphModelManager.onGraphChangedRaises the visual representation of the item above its current successor.
item above its current successor.item above its current successor in the containing parent.Parameters
- item: IModelItem
- The model item to raise.
See Also
Developer's Guide
Raises the visual representations of all IModelItems in items above their current successors.
items above their current successors.items above their current successors in their containing parent.Parameters
- items: IEnumerable<IModelItem>
- The IModelItems to raise.
See Also
Developer's Guide
Lowers the visual representation of the item to the back.
item to the back.Lowers the visual representation of all IModelItems in items to the back.
items to the back.items to the back in their containing parent.Parameters
- items: IEnumerable<IModelItem>
- The IModelItems to move to the back.
See Also
Developer's Guide
Raises the visual representation of the item to the front.
item to the front.Raises the visual representations of all IModelItems in items to the front.
items to the front.items to the front in their containing parent.Parameters
- items: IEnumerable<IModelItem>
- The IModelItems to move to the front.
See Also
Developer's Guide
Reverts the install method.
Parameters
- canvasComponent: CanvasComponent
- The CanvasComponent.