Packagecom.yworks.yfiles.layout.tree
Classpublic class NodeOrderComparator
InheritanceNodeOrderComparator Inheritance YObject Inheritance Object
Implements Comparator, Comparators_PartialOrder

This comparator compares edges by examining the com.yworks.bridge.util.Comparable that is obtained by passing the target nodes (com.yworks.yfiles.base.Edge.target()) to the get method (com.yworks.yfiles.base.DataProvider.getObject()) of the com.yworks.yfiles.base.DataProvider bound to the graph via the NODE_ORDER_DPKEY key.

See also

com.yworks.yfiles.layout.tree.TreeLayouter.comparator
com.yworks.yfiles.layout.tree.GenericTreeLayouter.defaultChildComparator
com.yworks.yfiles.layout.tree.GenericTreeLayouter.CHILD_COMPARATOR_DPKEY
com.yworks.yfiles.layout.tree.BalloonLayouter.comparator
com.yworks.yfiles.layout.tree.ARTreeLayouter.comparator
com.yworks.yfiles.layout.tree.HVTreeLayouter.comparator
NODE_ORDER_DPKEY
com.yworks.bridge.util.Comparable
target nodes
get method
com.yworks.yfiles.base.DataProvider


Public Methods
 MethodDefined By
  
NodeOrderComparator(init:Boolean = true)
NodeOrderComparator
  
compare(a:Object, b:Object):int
Object is actually expected to be com.yworks.yfiles.base.Edge.
NodeOrderComparator
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
NodeOrderComparator
 Inherited
hashCode():int
YObject
  
[static]
NodeOrderComparator
Protected Methods
 MethodDefined By
  
NodeOrderComparator
Public Constants
 ConstantDefined By
  NODE_ORDER_DPKEY : Object = y.layout.tree.TreeLayouter.NODE_ORDER_DPKEY
[static] A data provider key that can be used to register a com.yworks.yfiles.base.DataProvider for each com.yworks.yfiles.base.Node in the graph that yields a com.yworks.bridge.util.Comparable object via the com.yworks.yfiles.base.DataProvider.getObject() method.
NodeOrderComparator
Constructor Detail
NodeOrderComparator()Constructor
public function NodeOrderComparator(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
compare()method
public function compare(a:Object, b:Object):int

Object is actually expected to be com.yworks.yfiles.base.Edge. Compares values returned by com.yworks.yfiles.base.DataProvider.getObject() for the target nodes (com.yworks.yfiles.base.Edge.target()) of the edges. null values or instances that do not implement the com.yworks.bridge.util.Comparable interface will be treated as (equal) smaller values.

Parameters

a:Object
 
b:Object

Returns
int

See also

getClass()method 
override public function getClass():Class

Returns
Class
initNodeOrderComparator()method 
protected final function initNodeOrderComparator():void

newNodeOrderComparator()method 
public static function newNodeOrderComparator():NodeOrderComparator

Returns
NodeOrderComparator
Constant Detail
NODE_ORDER_DPKEYConstant
public static const NODE_ORDER_DPKEY:Object = y.layout.tree.TreeLayouter.NODE_ORDER_DPKEY

A data provider key that can be used to register a com.yworks.yfiles.base.DataProvider for each com.yworks.yfiles.base.Node in the graph that yields a com.yworks.bridge.util.Comparable object via the com.yworks.yfiles.base.DataProvider.getObject() method. The values can be used by the various tree layouter implementations to sort the children of each node in the tree and use the order to influence the layout. To achieve this use this comparator and assign it to the layouter implementations comparator property.

See also