Packagecom.yworks.yfiles.layout
Classpublic class NodeHalo
InheritanceNodeHalo Inheritance YObject Inheritance Object

A NodeHalo object specifies a rectangular area around a specific node. A layouter that supports node halos, keeps this area clear of graph elements, except the node labels of this specific node and the adjacent segments of its edges. All minimum distances to this node, which are used in the layout calculation e.g. minimal first segment length, will be extended by the halo size.

This class defines a key used to associate a com.yworks.yfiles.base.DataProvider that provide node halos for all nodes of the input graph. Node halo aware layout algorithms like com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter look for data providers named by this key to retrieve halo information.

The following layouters support NodeHalos with different restrictions:

See also

com.yworks.yfiles.base.DataProvider
com.yworks.yfiles.layout.hierarchic.IncrementalHierarchicLayouter
com.yworks.yfiles.layout.orthogonal.OrthogonalLayouter
com.yworks.yfiles.layout.orthogonal.CompactOrthogonalLayouter
com.yworks.yfiles.layout.orthogonal.OrthogonalGroupLayouter
com.yworks.yfiles.layout.orthogonal.DirectedOrthogonalLayouter
com.yworks.yfiles.layout.tree.GenericTreeLayouter
com.yworks.yfiles.layout.tree.TreeLayouter
com.yworks.yfiles.layout.organic.SmartOrganicLayouter
com.yworks.yfiles.layout.organic.SmartOrganicLayouter.SCOPE_SUBSET
com.yworks.yfiles.layout.organic.SmartOrganicLayouter.SCOPE_MAINLY_SUBSET
com.yworks.yfiles.layout.labeling.MISLabelingAlgorithm
com.yworks.yfiles.layout.router.polyline.EdgeRouter
com.yworks.yfiles.layout.circular.CircularLayouter
allows overlaps
com.yworks.yfiles.layout.tree.BalloonLayouter
com.yworks.yfiles.layout.tree.BalloonLayouter.allowOverlaps
com.yworks.yfiles.layout.SelfLoopLayouter
com.yworks.yfiles.layout.radial.RadialLayouter
com.yworks.yfiles.layout.grouping.RecursiveGroupLayouter
com.yworks.yfiles.layout.ComponentLayouter


Public Properties
 PropertyDefined By
  bottom : Number
The halo size at the bottom side of the node.
NodeHalo
  left : Number
The halo size at the left side of the node.
NodeHalo
  right : Number
The halo size at the right side of the node.
NodeHalo
  top : Number
The halo size at the top side of the node.
NodeHalo
  ZERO_HALO : NodeHalo
[static] [read-only] A constant holding a NodeHalo with zero size on each side.
NodeHalo
Public Methods
 MethodDefined By
  
NodeHalo(init:Boolean = true)
NodeHalo
  
create(value:Number):NodeHalo
[static] Creates a NodeHalo object with the specified value on each side of the node.
NodeHalo
  
createFromTLBR(top:Number, left:Number, bottom:Number, right:Number):NodeHalo
[static] Creates a NodeHalo object with the specified values.
NodeHalo
  
equals(o:Object):Boolean
[override]
NodeHalo
  
getClass():Class
[override]
NodeHalo
  
[static] Returns the NodeHalo of the given node if available, otherwise a NodeHalo with zero size.
NodeHalo
  
[static] Returns a com.yworks.yfiles.geom.YRectangle instance with the bounds of the given node and if available its NodeHalo.
NodeHalo
  
hasHalos(graph:LayoutGraph):Boolean
[static] Checks whether a com.yworks.yfiles.base.DataProvider has been registered at the given graph, that holds NodeHalo instances.
NodeHalo
  
hashCode():int
[override]
NodeHalo
Public Constants
 ConstantDefined By
  NODE_HALO_DPKEY : Object = y.layout.NodeHalo.NODE_HALO_DPKEY
[static] com.yworks.yfiles.base.DataProvider key that can be used to store com.yworks.yfiles.layout.NodeHalo -instances for the nodes that specify the sizes of the nodes' halos.
NodeHalo
Property Detail
bottomproperty
public var bottom:Number

The halo size at the bottom side of the node.

leftproperty 
public var left:Number

The halo size at the left side of the node.

rightproperty 
public var right:Number

The halo size at the right side of the node.

topproperty 
public var top:Number

The halo size at the top side of the node.

ZERO_HALOproperty 
ZERO_HALO:NodeHalo  [read-only]

A constant holding a NodeHalo with zero size on each side.


Implementation
    public static function get ZERO_HALO():NodeHalo
Constructor Detail
NodeHalo()Constructor
public function NodeHalo(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
create()method
public static function create(value:Number):NodeHalo

Creates a NodeHalo object with the specified value on each side of the node. The value must not be negative, Number.NaN or Number.POSITIVE_INFINITY, otherwise the method will throw an IllegalArgumentException.

Parameters

value:Number — The halo size at each side of the node.

Returns
NodeHalo

Throws
IllegalArgumentException — if the value is negative, Number.NaN or Number.POSITIVE_INFINITY

See also

Number.NaN
Number.POSITIVE_INFINITY
createFromTLBR()method 
public static function createFromTLBR(top:Number, left:Number, bottom:Number, right:Number):NodeHalo

Creates a NodeHalo object with the specified values. The values must not be negative, Number.NaN or Number.POSITIVE_INFINITY, otherwise the method will throw an IllegalArgumentException.

Parameters

top:Number — The halo size at the top side of the node.
 
left:Number — The halo size at the left side of the node.
 
bottom:Number — The halo size at the bottom side of the node.
 
right:Number — The halo size at the right side of the node.

Returns
NodeHalo

Throws
IllegalArgumentException — if one of the values is negative, Number.NaN or Number.POSITIVE_INFINITY

See also

Number.NaN
Number.POSITIVE_INFINITY
equals()method 
override public function equals(o:Object):Boolean

Parameters

o:Object

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

Returns
Class
getHalo()method 
public static function getHalo(graph:LayoutGraph, node:Node):NodeHalo

Returns the NodeHalo of the given node if available, otherwise a NodeHalo with zero size.

Parameters

graph:LayoutGraph — The graph containing the given node.
 
node:Node — The node whose NodeHalo will be determined.

Returns
NodeHalo — the NodeHalo of the given node if available, otherwise a NodeHalo with zero size.
getHaloBox()method 
public static function getHaloBox(graph:LayoutGraph, node:Node):YRectangle

Returns a com.yworks.yfiles.geom.YRectangle instance with the bounds of the given node and if available its NodeHalo.

Parameters

graph:LayoutGraph — The graph containing the given node.
 
node:Node — The node whose NodeHalo will be determined.

Returns
YRectangle — a com.yworks.yfiles.geom.YRectangle instance with the bounds of the given node and if available its NodeHalo

See also

hasHalos()method 
public static function hasHalos(graph:LayoutGraph):Boolean

Checks whether a com.yworks.yfiles.base.DataProvider has been registered at the given graph, that holds NodeHalo instances.

Parameters

graph:LayoutGraph — The graph to check.

Returns
Booleantrue if a com.yworks.yfiles.base.DataProvider has been registered at the given graph, that holds NodeHalo instances, false otherwise.

See also

hashCode()method 
override public function hashCode():int

Returns
int
Constant Detail
NODE_HALO_DPKEYConstant
public static const NODE_HALO_DPKEY:Object = y.layout.NodeHalo.NODE_HALO_DPKEY

com.yworks.yfiles.base.DataProvider key that can be used to store com.yworks.yfiles.layout.NodeHalo -instances for the nodes that specify the sizes of the nodes' halos.

See also