Packagecom.asterisq.graph.views
Classpublic class MaxNodesGraphView
InheritanceMaxNodesGraphView Inheritance SynchronizedGraphView Inheritance flash.events.EventDispatcher
ImplementsIGraphView

A view which limits the number of nodes. This view will remove nodes and their edges until the number of nodes falls below the specified maximum.

A node comparator function can be specified to arrange nodes in order of importance. See the nodeComparator property for details.

Protected nodes can also be specified. These nodes always be included in the view, even if it means breaking the maximum node limit.



Public Properties
 PropertyDefined by
 InheritedautomaticViewInvalidation : Boolean
Indicates whether the view is automatically invalidated when the model changes.
SynchronizedGraphView
  maxNodes : int
The maximum number of nodes allowed in the view.
MaxNodesGraphView
 Inheritedmodel : IGraph
The model from which the contents of this view is calculated.
SynchronizedGraphView
  nodeComparator : Function
The comparator function for sorting nodes before filtering.
MaxNodesGraphView
  protectedNodeIDs : Array
IDs of nodes that should never be removed.
MaxNodesGraphView
 Inheritedview : IGraph
The calculated contents of this view.
SynchronizedGraphView
 InheritedviewInvalid : Boolean
Indicates whether the view is currently invalid.
SynchronizedGraphView
Public Methods
 MethodDefined by
  
Creates a new TreeGraphView.
MaxNodesGraphView
 Inherited
invalidate():void
Schedules the view for validation during the next render cycle.
SynchronizedGraphView
 Inherited
validateNow():void
Immediately recalculates the view.
SynchronizedGraphView
Protected Methods
 MethodDefined by
  
validate():Boolean
Recalculates the contents of the view from the model data.
MaxNodesGraphView
Property detail
maxNodesproperty
maxNodes:int  [read-write]

The maximum number of nodes allowed in the view. Default is 20.

Implementation
    public function get maxNodes():int
    public function set maxNodes(value:int):void
nodeComparatorproperty 
nodeComparator:Function  [read-write]

The comparator function for sorting nodes before filtering. The function should take two INodes, A and B, as arguments and return a negative integer, zero, or a positive integer.

If the comparator is null, no sorting will be performed.

Implementation
    public function get nodeComparator():Function
    public function set nodeComparator(value:Function):void
protectedNodeIDsproperty 
protectedNodeIDs:Array  [read-write]

IDs of nodes that should never be removed. These nodes will be included in the view even if it breaks the maximum nodes limit.

Implementation
    public function get protectedNodeIDs():Array
    public function set protectedNodeIDs(value:Array):void
Constructor detail
MaxNodesGraphView()constructor
public function MaxNodesGraphView()

Creates a new TreeGraphView.

Method detail
validate()method
protected override function validate():Boolean

Recalculates the contents of the view from the model data.

Returns
Boolean