Packagecom.yworks.graph.model
Classpublic class FilteredGraphWrapper
InheritanceFilteredGraphWrapper Inheritance AbstractGraphWrapper Inheritance flash.events.EventDispatcher

A decorator implementation of an IGraph that represents a subset of the wrapped graph instance.

Note that this instance will register listeners with the wrapped graph, so dispose() should be called if this instance is not used any more.

This implementation supports the filtering of grouped graphs.

See also

dispose()


Public Properties
 PropertyDefined By
  bends : ICollectionModel
[override] [read-only]
FilteredGraphWrapper
  collectionModel : ICollectionModel
[override] [read-only]
FilteredGraphWrapper
 InheriteddefaultEdgeLabelModelParameter : ILabelModelParameter
Gets or sets the default ILabelModelParameter that will be used for newly created edge labels if no other parameter is specified.
AbstractGraphWrapper
 InheriteddefaultEdgeLabelStyle : ILabelStyle
Gets or sets the default ILabelStyle that will be used for newly created edge labels if no other style is specified.
AbstractGraphWrapper
 InheriteddefaultEdgeStyle : IEdgeStyle
Gets or sets the default IEdgeStyle that will be used for newly created edges if no other style is specified.
AbstractGraphWrapper
 InheriteddefaultNodeLabelModelParameter : ILabelModelParameter
Gets or sets the default ILabelModelParameter that will be used for newly created node labels if no other parameter is specified.
AbstractGraphWrapper
 InheriteddefaultNodeLabelStyle : ILabelStyle
Gets or sets the default ILabelStyle that will be used for newly created node labels if no other style is specified.
AbstractGraphWrapper
 InheriteddefaultNodePortModelParameter : IPortLocationModelParameter
Gets or sets the default IPortLocationModelParameter that will be used for newly created node ports if no other parameter is specified.
AbstractGraphWrapper
 InheriteddefaultNodeSize : ISize
Gets or sets the default node size.
AbstractGraphWrapper
 InheriteddefaultNodeStyle : INodeStyle
Gets or sets the default INodeStyle that will be used for newly created nodes if no other style is specified.
AbstractGraphWrapper
 InheriteddefaultPortStyle : IPortStyle
Gets or sets the default IPortStyle that will be used for newly created ports if no other style is specified.
AbstractGraphWrapper
  edgeLabels : ICollectionModel
[override] [read-only]
FilteredGraphWrapper
  edgePredicate : Function
[read-only] The predicate function for the edges.
FilteredGraphWrapper
  edges : ICollectionModel
[override] [read-only]
FilteredGraphWrapper
  fullGraph : IGraph
[read-only] Gets the full graph that has been wrapped by this instance.
FilteredGraphWrapper
 InheritedmapperRegistry : IMapperRegistry
[read-only] A registry that can be used to store and retrieve arbitrary information for items in this graph.
AbstractGraphWrapper
  nodeLabels : ICollectionModel
[override] [read-only]
FilteredGraphWrapper
  nodePredicate : Function
[read-only] The predicate function for the nodes.
FilteredGraphWrapper
  nodes : ICollectionModel
[override] [read-only]
FilteredGraphWrapper
  ports : ICollectionModel
[override] [read-only]
FilteredGraphWrapper
  wrappedGraph : IGraph
[read-only] Returns the wrapped graph instance that was passed upon creation of this instance.
FilteredGraphWrapper
Protected Properties
 PropertyDefined By
 Inheritedgraph : IGraph
The wrapped graph instance.
AbstractGraphWrapper
Public Methods
 MethodDefined By
  
FilteredGraphWrapper(graph:IGraph, nodePredicate:Function, edgePredicate:Function)
Creates a new graph instance that wraps the original graph and uses the passed predicate functions to determine which nodes and edges should be contained in the graph.
FilteredGraphWrapper
 Inherited
addBend(edge:IEdge, index:int, x:Number, y:Number):IBend
Adds a bend at the given index to the given edge using the coordinates provided.
AbstractGraphWrapper
 Inherited
addLabel(item:ILabeledItem, text:String, labelModelParameter:ILabelModelParameter = null, style:ILabelStyle = null):ILabel
Add a label to the given item using the text as the initial label text and label model parameter and style.
AbstractGraphWrapper
 Inherited
addPort(portOwner:IPortOwner, x:Number, y:Number):IPort
Add a port to the given port owner using the coordinates as the new initial position of the port anchor.
AbstractGraphWrapper
 Inherited
Add a port to the given port owner using the model parameter to determine the coordinates of the port.
AbstractGraphWrapper
 Inherited
clear():void
Clears this instance, removing all entities in proper order.
AbstractGraphWrapper
 Inherited
clearBends(edge:IEdge):void
Removes all bends from the given edge.
AbstractGraphWrapper
  
contains(item:IModelItem):Boolean
[override] Returns true if this collection contains the specified element.
FilteredGraphWrapper
 Inherited
createEdge(sourcePort:IPort, targetPort:IPort, style:IEdgeStyle = null):IEdge
Creates and returns an edge that connects to the given port instances.
AbstractGraphWrapper
 Inherited
createEdgeBetweenNodes(sourceNode:INode, targetNode:INode, style:IEdgeStyle = null):IEdge
Convenience method that creates and returns an edge that connects to the given node instances using the given style instance.
AbstractGraphWrapper
 Inherited
createNode(bounds:IRectangle = null, style:INodeStyle = null):INode
Creates and returns a node using default values for the style and the specified initial geometry.
AbstractGraphWrapper
 Inherited
createNodeAt(x:Number, y:Number):INode
Creates and returns a node using default values for the style and the specified initial geometry.
AbstractGraphWrapper
  
dispose():void
[override] Disposes this instance.
FilteredGraphWrapper
  
Should be called by the client if the edge predicate function changed for the edges in the graph.
FilteredGraphWrapper
  
Should be called by clients if the edge predicate function changed for the given edge.
FilteredGraphWrapper
  
[override]
FilteredGraphWrapper
  
[override]
FilteredGraphWrapper
 Inherited
Gets the lookup instance to use in lookup()
AbstractGraphWrapper
 Inherited
Causes the displaysInvalidated event to be triggered.
AbstractGraphWrapper
  
lookup(type:Class):Object
[override]
FilteredGraphWrapper
  
Should be called by the client if the node predicate function changed for the nodes in the graph.
FilteredGraphWrapper
  
Should be called by clients if the node predicate function changed for the given node.
FilteredGraphWrapper
 Inherited
removeBend(bend:IBend):void
Removes the given bend instance from its edge.
AbstractGraphWrapper
 Inherited
removeEdge(edge:IEdge):void
Removes the given edge instance from this graph.
AbstractGraphWrapper
 Inherited
removeLabel(label:ILabel):void
Removes the given label from its owner.
AbstractGraphWrapper
 Inherited
removeNode(node:INode):void
Removes the given node instance from this graph.
AbstractGraphWrapper
 Inherited
removePort(port:IPort):void
Removes the port from its owner.
AbstractGraphWrapper
 Inherited
setBendLocation(bend:IBend, x:Number, y:Number):void
Modifies the location of the given bend.
AbstractGraphWrapper
 Inherited
setBounds(node:INode, x:Number, y:Number, width:Number, height:Number):void
Sets the bounds of the given node to the new values.
AbstractGraphWrapper
 Inherited
setEdgeStyle(edge:IEdge, style:IEdgeStyle):void
Assigns the given style instance by reference to the edge.
AbstractGraphWrapper
 Inherited
Sets the label model parameter for the given label.
AbstractGraphWrapper
 Inherited
setLabelStyle(label:ILabel, style:ILabelStyle):void
Assigns the given style instance by reference to the label.
AbstractGraphWrapper
 Inherited
setLabelText(label:ILabel, text:String):void
Sets the label text of the given label.
AbstractGraphWrapper
 Inherited
setLookup(newLookup:ILookup):void
Sets the lookup instance to use in lookup()
AbstractGraphWrapper
 Inherited
setNodeStyle(node:INode, style:INodeStyle):void
Assigns the given style instance by reference to the node.
AbstractGraphWrapper
 Inherited
setPortLocation(port:IPort, x:Number, y:Number):void
Sets the coordinates of the given port to the given values.
AbstractGraphWrapper
 Inherited
Sets the location model parameter of the given port to the given value.
AbstractGraphWrapper
 Inherited
setPorts(edge:IEdge, sourcePort:IPort, targetPort:IPort):void
Sets the ports of the given edge to the new values.
AbstractGraphWrapper
 Inherited
setPortStyle(port:IPort, style:IPortStyle):void
Assigns the given style instance by reference to the port.
AbstractGraphWrapper
 Inherited
setPreferredSize(label:ILabel, width:Number, height:Number):void
Sets the preferred size of the label.
AbstractGraphWrapper
Protected Methods
 MethodDefined By
 Inherited
Adds event handlers that propagate graph events from the provided graph to listeners on this instance.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the InvalidateEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Dispatches the GraphEvent.
AbstractGraphWrapper
 Inherited
Removes event handlers for the given graph that have been added with addEventHandlers.
AbstractGraphWrapper
Property Detail
bendsproperty
bends:ICollectionModel  [read-only] [override]


Implementation
    public function get bends():ICollectionModel
collectionModelproperty 
collectionModel:ICollectionModel  [read-only] [override]


Implementation
    public function get collectionModel():ICollectionModel
edgeLabelsproperty 
edgeLabels:ICollectionModel  [read-only] [override]


Implementation
    public function get edgeLabels():ICollectionModel
edgePredicateproperty 
edgePredicate:Function  [read-only]

The predicate function for the edges. The signature of this function should be:

function (edge:IEdge):Edge


Implementation
    public function get edgePredicate():Function
edgesproperty 
edges:ICollectionModel  [read-only] [override]


Implementation
    public function get edges():ICollectionModel
fullGraphproperty 
fullGraph:IGraph  [read-only]

Gets the full graph that has been wrapped by this instance.


Implementation
    public function get fullGraph():IGraph
nodeLabelsproperty 
nodeLabels:ICollectionModel  [read-only] [override]


Implementation
    public function get nodeLabels():ICollectionModel
nodePredicateproperty 
nodePredicate:Function  [read-only]

The predicate function for the nodes. The signature of this function should be:

function (node:INode):Boolean


Implementation
    public function get nodePredicate():Function
nodesproperty 
nodes:ICollectionModel  [read-only] [override]


Implementation
    public function get nodes():ICollectionModel
portsproperty 
ports:ICollectionModel  [read-only] [override]


Implementation
    public function get ports():ICollectionModel
wrappedGraphproperty 
wrappedGraph:IGraph  [read-only]

Returns the wrapped graph instance that was passed upon creation of this instance.


Implementation
    public function get wrappedGraph():IGraph
Constructor Detail
FilteredGraphWrapper()Constructor
public function FilteredGraphWrapper(graph:IGraph, nodePredicate:Function, edgePredicate:Function)

Creates a new graph instance that wraps the original graph and uses the passed predicate functions to determine which nodes and edges should be contained in the graph.

Note that this instance will register listeners with the wrapped graph, so dispose() should be called if this instance is not used any more.

Parameters
graph:IGraph — The graph to wrap
 
nodePredicate:Function — The predicate function that determines which nodes to keep. A function with the signature function( node:INode):Boolean which returns true if the node should be contained in the graph.
 
edgePredicate:Function — The predicate function that determines which edges to keep. A function with the signature function( edge:INode):Boolean which returns true if the edge should be contained in the graph.

See also

Method Detail
contains()method
override public function contains(item:IModelItem):Boolean

Returns true if this collection contains the specified element.

Parameters

item:IModelItem — element whose presence in this collection is to be tested

Returns
Boolean — true if this collection contains the specified element
dispose()method 
override public function dispose():void

Disposes this instance.

edgePredicateChanged()method 
public function edgePredicateChanged():void

Should be called by the client if the edge predicate function changed for the edges in the graph.

edgePredicateChangedForEdge()method 
public function edgePredicateChangedForEdge(edge:IEdge):void

Should be called by clients if the edge predicate function changed for the given edge.

Parameters

edge:IEdge — The edge.

See also

edgesAtPort()method 
override public function edgesAtPort(port:IPort):Iterable

Parameters

port:IPort

Returns
Iterable
edgesAtPortOwner()method 
override public function edgesAtPortOwner(portOwner:IPortOwner):Iterable

Parameters

portOwner:IPortOwner

Returns
Iterable
lookup()method 
override public function lookup(type:Class):Object

Parameters

type:Class

Returns
Object
nodePredicateChanged()method 
public function nodePredicateChanged():void

Should be called by the client if the node predicate function changed for the nodes in the graph.

nodePredicateChangedForNode()method 
public function nodePredicateChangedForNode(node:INode):void

Should be called by clients if the node predicate function changed for the given node.

Parameters

node:INode — The node.

See also