Packagecom.yworks.yfiles.layout.hierarchic
Classpublic class MedianLinearSegmentDrawer
InheritanceMedianLinearSegmentDrawer Inheritance AbstractDrawer Inheritance YObject Inheritance Object

This class implements the third phase of the hierarchic layout algorithm. Edges are represented as polylines with at most two bends. The algorithm has linear running time and is based on the article [BK01]:

U. Brandes and B. Koepf, Fast and Simple Horizontal Coordinate Assignment, Proceedings of 9th Symposium of Graph Drawing, LNCS, 2001.



Public Properties
 PropertyDefined By
 InheriteddummyMap : NodeMap
[write-only] Gives the drawer the opportunity to distinguish between dummy nodes and real ones.
AbstractDrawer
 InheritededgeLengthKey : Object
[write-only] Set the key to the data provider, which stores the length of the edges.
AbstractDrawer
 InheritedgraphInternal : LayoutGraph
[read-only]
AbstractDrawer
 InheritedminimalEdgeDistance : Number
Specifies the minimal distance between two edges in the same layer.
AbstractDrawer
 InheritedminimalLayerDistance : Number
Specifies the minimal distance between two layers.
AbstractDrawer
 InheritedminimalMultiEdgeDistance : Number
Specifies the minimal distance between two edges sharing source/target in the same layer.
AbstractDrawer
 InheritedminimalNodeDistance : Number
Specifies the minimal distance between two nodes in the same layer.
AbstractDrawer
Protected Properties
 PropertyDefined By
 InheriteddistanceToNextNode : NodeMap
Stores the minimal distance between the right border of a node and the left border of its right hand side neighbor in a layer.
AbstractDrawer
 Inherited_dummyMap : NodeMap
See dummyMap
AbstractDrawer
 Inherited_edgeLengthKey : Object
The key to the data provider, which stores the length of the edges.
AbstractDrawer
 Inheritedgraph : LayoutGraph
The graph bound to this drawer instance.
AbstractDrawer
 Inherited_minimalEdgeDistance : Number
The minimal distance between two edges in the same layer.
AbstractDrawer
 Inherited_minimalLayerDistance : Number
The minimal distance between two layers.
AbstractDrawer
 Inherited_minimalMultiEdgeDistance : Number
The minimal distance between two edges sharing source/target in the same layer.
AbstractDrawer
 Inherited_minimalNodeDistance : Number
The minimal distance between two nodes in the same layer.
AbstractDrawer
Public Methods
 MethodDefined By
  
MedianLinearSegmentDrawer(init:Boolean = true)
MedianLinearSegmentDrawer
 Inherited
assignCoordinates(g:LayoutGraph, layerLists:Vector.<Object>, layerID:DataProvider):void
Binds the specified graph to this drawer and calls the abstract method assignFinalCoordinates()
AbstractDrawer
 Inherited
assignYCoords(graph:LayoutGraph, layerLists:Vector.<Object>):void
Assign the y coordinates to the nodes respecting the minimal layer distance.
AbstractDrawer
 Inherited
assignYCoords2(graph:LayoutGraph, layers:Vector.<Object>):void
Assign the y coordinates to the nodes respecting the minimal layer distance.
AbstractDrawer
 Inherited
equals(o:Object):Boolean
YObject
 Inherited
Returns the height of the bottom border of the given node.
AbstractDrawer
 Inherited
Returns the height of the border-obeying bottom half of the node,
AbstractDrawer
 Inherited
getBottomY(v:Node):Number
Returns the border obeying bottom y-coordinate of the given node.
AbstractDrawer
  
getClass():Class
[override]
MedianLinearSegmentDrawer
 Inherited
Returns the border obeying full height of the given node.
AbstractDrawer
 Inherited
getFullWidth(v:Node):Number
Returns the border obeying full width of the given node.
AbstractDrawer
 Inherited
Returns the width of the left border of the given node.
AbstractDrawer
 Inherited
getLeftHalf(v:Node):Number
Returns the width of the border-obeying left half of the node,
AbstractDrawer
 Inherited
getLeftX(v:Node):Number
Returns the border obeying left x-coordinate of the given node.
AbstractDrawer
 Inherited
Returns the width of the right border of the given node.
AbstractDrawer
 Inherited
getRightHalf(v:Node):Number
Returns the width of the border-obeying right half of the node,
AbstractDrawer
 Inherited
getRightX(v:Node):Number
Returns the border obeying right x-coordinate of the given node.
AbstractDrawer
 Inherited
getTopBorder(v:Node):Number
Returns the height of the top border of the given node.
AbstractDrawer
 Inherited
getTopHalf(v:Node):Number
Returns the height of the border-obeying top half of the node,
AbstractDrawer
 Inherited
getTopY(v:Node):Number
Returns the border obeying top y-coordinate of the given node.
AbstractDrawer
 Inherited
hashCode():int
YObject
  
markConflicts(layerLists:Vector.<Object>, conflictMark:EdgeMap, dummyMap:NodeMap, pos:Vector.<int>):void
[static] Mark type 1 conflicts.
MedianLinearSegmentDrawer
  
[static]
MedianLinearSegmentDrawer
  
verticalAlignment(g:LayoutGraph, layerLists:Vector.<Object>):void
Calculates vertical alignment.
MedianLinearSegmentDrawer
Protected Methods
 MethodDefined By
  
assignFinalCoordinates(layerLists:Vector.<Object>, _layerID:DataProvider):void
[override] Performs coordinate assignment.
MedianLinearSegmentDrawer
  
dispose():void
[override] Frees held resources.
MedianLinearSegmentDrawer
 Inherited
Returns the minimal distance between the right border of the given node and the left border of its right hand side neighbor in the layer.
AbstractDrawer
  
horizontalCompaction(g:LayoutGraph, x:Vector.<Number>, layerLists:Vector.<Object>):void
Calculate coordinates.
MedianLinearSegmentDrawer
  
init(g:Graph, layerLists:Vector.<Object>):void
Initializes data structures for all runs.
MedianLinearSegmentDrawer
 Inherited
AbstractDrawer
 Inherited
initializeDistancesToNextNode(layerLists:Vector.<Object>):void
Initializes the minimal distances between the right border of a node and the left border of its right hand side neighbor in a layer.
AbstractDrawer
  
MedianLinearSegmentDrawer
  
Writes the calculated x values in the layout graph.
MedianLinearSegmentDrawer
  
reinit(g:Graph, x:Vector.<Number>):void
Initializes data structures for one basic step.
MedianLinearSegmentDrawer
Constructor Detail
MedianLinearSegmentDrawer()Constructor
public function MedianLinearSegmentDrawer(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
assignFinalCoordinates()method
override protected function assignFinalCoordinates(layerLists:Vector.<Object>, _layerID:DataProvider):void

Performs coordinate assignment.

Parameters

layerLists:Vector.<Object>
 
_layerID:DataProvider

dispose()method 
override protected function dispose():void

Frees held resources.

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

Returns
Class
horizontalCompaction()method 
protected function horizontalCompaction(g:LayoutGraph, x:Vector.<Number>, layerLists:Vector.<Object>):void

Calculate coordinates. This method corresponds to Algorithm 3 in [BK01].

Parameters

g:LayoutGraph — the graph for which the layout is calculated.
 
x:Vector.<Number> — the array where the result is stored.
 
layerLists:Vector.<Object>

init()method 
protected function init(g:Graph, layerLists:Vector.<Object>):void

Initializes data structures for all runs.

Parameters

g:Graph
 
layerLists:Vector.<Object>

initMedianLinearSegmentDrawer()method 
protected final function initMedianLinearSegmentDrawer():void

markConflicts()method 
public static function markConflicts(layerLists:Vector.<Object>, conflictMark:EdgeMap, dummyMap:NodeMap, pos:Vector.<int>):void

Mark type 1 conflicts. This method corresponds to Algorithm 1 in [BK01].

Parameters

layerLists:Vector.<Object> — the list of layers.
 
conflictMark:EdgeMap — used to mark the conflicting edges.
 
dummyMap:NodeMap — map which returns true for bends, false otherwise.
 
pos:Vector.<int> — is indexed by the index method of node and returns the rank of a node inside the layer which contains the node.

newMedianLinearSegmentDrawer()method 
public static function newMedianLinearSegmentDrawer():MedianLinearSegmentDrawer

Returns
MedianLinearSegmentDrawer
propagateCoordinates()method 
protected function propagateCoordinates(g:LayoutGraph):void

Writes the calculated x values in the layout graph.

Parameters

g:LayoutGraph

reinit()method 
protected function reinit(g:Graph, x:Vector.<Number>):void

Initializes data structures for one basic step.

Parameters

g:Graph
 
x:Vector.<Number> — the array where the coordinates will be stored.

verticalAlignment()method 
public function verticalAlignment(g:LayoutGraph, layerLists:Vector.<Object>):void

Calculates vertical alignment. This method corresponds to Algorithm 2 in [BK01].

Parameters

g:LayoutGraph — the graph for which the layout is calculated.
 
layerLists:Vector.<Object> — the list of layers.