Packagecom.yworks.graph.model
Classpublic class GraphObstacleProvider
InheritanceGraphObstacleProvider Inheritance Object
Implements IObstacleProvider

A convenience composite implementation of the IObstacleProvider that will use the edges and nodes collections of an IGraph from the IPaintContext.

This class can be used to add bridge support via the BridgeManager to a rendered IGraph.

See also

com.yworks.canvas.model.BridgeManager.addObstacleProvider()
com.yworks.canvas.model.IObstacleProvider


Public Properties
 PropertyDefined By
  queryEdges : Boolean
Whether to query the edges for an IObstacleProvider implementation.
GraphObstacleProvider
  queryNodes : Boolean
Whether to query the nodes for an IObstacleProvider implementation.
GraphObstacleProvider
Public Methods
 MethodDefined By
  
Iterates over all edges and nodes to query an IObstacleProvider from the IModelItem's lookup.
GraphObstacleProvider
Protected Methods
 MethodDefined By
  
Helper method that retrieves the IGraph to use from the canvasContext.
GraphObstacleProvider
Property Detail
queryEdgesproperty
queryEdges:Boolean

Whether to query the edges for an IObstacleProvider implementation.

true if edges should be queried at all; otherwise, false.

The default value is true.


Implementation
    public function get queryEdges():Boolean
    public function set queryEdges(value:Boolean):void
queryNodesproperty 
queryNodes:Boolean

Whether to query the nodes for an IObstacleProvider implementation.

true if nodes should be queried at all; otherwise, false.

The default value is false.


Implementation
    public function get queryNodes():Boolean
    public function set queryNodes(value:Boolean):void
Method Detail
getGraph()method
protected function getGraph(canvasContext:IPaintContext):IGraph

Helper method that retrieves the IGraph to use from the canvasContext.

This implementation uses the lookup of the IPaintContext.canvasComponent to query the IGraph implementation.

Parameters

canvasContext:IPaintContext — The context to retrieve the implementation from.

Returns
IGraph — The IGraph instance to query or null.
getObstacles()method 
public function getObstacles(canvasContext:IPaintContext):GeneralPath

Iterates over all edges and nodes to query an IObstacleProvider from the IModelItem's lookup.

This method will depending on the queryEdges and queryNodes property query the items for an implementation of IObstacleProvider and concatenate all resulting GeneralPath obstacles into one path that will then be returned.

Parameters

canvasContext:IPaintContext — The context where the obstacles are queried for.

Returns
GeneralPath — A path that is the concatenated path of all obstacles for the given context.