Packagecom.yworks.yfiles.layout.hierarchic
Classpublic class NodeLabelSpaceDrawer
InheritanceNodeLabelSpaceDrawer Inheritance YObject Inheritance Object
Implements Drawer

This class can be used to wrap com.yworks.yfiles.layout.hierarchic.Drawer implementations. It modifies the com.yworks.yfiles.layout.hierarchic.DrawerKeys.NODE_BORDER_LEFT and com.yworks.yfiles.layout.hierarchic.DrawerKeys.NODE_BORDER_RIGHT DataProvider instances and delegates the actual drawing to the inner drawer. Actual space requirements are calculated in getHaloSpace(). This implementation uses the maximum left and right label overlaps as the halo values. Note that this will only work with Drawer implementations that respect the values provided through the DataProviders, e.g. MedianLinearSegmentsDrawer and SimplexDrawer. Here is some example set up code.
 // create the Layouter HierarchicLayouter hl = new HierarchicLayouter(); // set a suitable Drawer hl.setDrawer(new SimplexDrawer()); // wrap the Drawer hl.setDrawer(new NodeLabelSpaceDrawer(hl.getDrawer())); 
This implementation uses com.yworks.yfiles.layout.NodeLabelLayout s and can therefor not be used with layout orientations other than top to bottom.

See also

com.yworks.yfiles.layout.hierarchic.Drawer
com.yworks.yfiles.layout.hierarchic.DrawerKeys.NODE_BORDER_LEFT
com.yworks.yfiles.layout.hierarchic.DrawerKeys.NODE_BORDER_RIGHT
getHaloSpace()
com.yworks.yfiles.layout.NodeLabelLayout


Public Properties
 PropertyDefined By
  dummyMap : NodeMap
[write-only]
NodeLabelSpaceDrawer
  minimalEdgeDistance : Number
[write-only]
NodeLabelSpaceDrawer
  minimalLayerDistance : Number
[write-only]
NodeLabelSpaceDrawer
  minimalMultiEdgeDistance : Number
[write-only]
NodeLabelSpaceDrawer
  minimalNodeDistance : Number
[write-only]
NodeLabelSpaceDrawer
Public Methods
 MethodDefined By
  
NodeLabelSpaceDrawer(inner:Drawer, init:Boolean = true)
Creates a new instance of NodeLabelSpaceDrawer
NodeLabelSpaceDrawer
  
assignCoordinates(g:LayoutGraph, layerLists:Vector.<Object>, layerID:DataProvider):void
NodeLabelSpaceDrawer
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
NodeLabelSpaceDrawer
 Inherited
hashCode():int
YObject
  
[static] Creates a new instance of NodeLabelSpaceDrawer
NodeLabelSpaceDrawer
Protected Methods
 MethodDefined By
  
getHaloSpace(node:Node, left:Boolean):Number
Calculates the horizontal space requirements for the given node.
NodeLabelSpaceDrawer
  
Initializes this object.
NodeLabelSpaceDrawer
Property Detail
dummyMapproperty
dummyMap:NodeMap  [write-only]


Implementation
    public function set dummyMap(value:NodeMap):void
minimalEdgeDistanceproperty 
minimalEdgeDistance:Number  [write-only]


Implementation
    public function set minimalEdgeDistance(value:Number):void
minimalLayerDistanceproperty 
minimalLayerDistance:Number  [write-only]


Implementation
    public function set minimalLayerDistance(value:Number):void
minimalMultiEdgeDistanceproperty 
minimalMultiEdgeDistance:Number  [write-only]


Implementation
    public function set minimalMultiEdgeDistance(value:Number):void
minimalNodeDistanceproperty 
minimalNodeDistance:Number  [write-only]


Implementation
    public function set minimalNodeDistance(value:Number):void
Constructor Detail
NodeLabelSpaceDrawer()Constructor
public function NodeLabelSpaceDrawer(inner:Drawer, init:Boolean = true)

Creates a new instance of NodeLabelSpaceDrawer

Parameters
inner:Drawer
 
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.
Method Detail
assignCoordinates()method
public function assignCoordinates(g:LayoutGraph, layerLists:Vector.<Object>, layerID:DataProvider):void

Parameters

g:LayoutGraph
 
layerLists:Vector.<Object>
 
layerID:DataProvider

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

Returns
Class
getHaloSpace()method 
protected function getHaloSpace(node:Node, left:Boolean):Number

Calculates the horizontal space requirements for the given node. This implementation uses the maximum left and right label overlaps as the halo values.

Parameters

node:Node — The node to calculate the halo for.
 
left:Boolean — Whether to calculate the left (true) or right (false) halo.

Returns
Number — The additional space needed by the given node at the given side.
initNodeLabelSpaceDrawer()method 
protected final function initNodeLabelSpaceDrawer(inner:Drawer):void

Initializes this object. See the documentation of the corresponding factory method newNodeLabelSpaceDrawer() for details.

Parameters

inner:Drawer

See also

newNodeLabelSpaceDrawer()method 
public static function newNodeLabelSpaceDrawer(inner:Drawer):NodeLabelSpaceDrawer

Creates a new instance of NodeLabelSpaceDrawer

Parameters

inner:Drawer

Returns
NodeLabelSpaceDrawer