com.mindfusion.diagramming
Class HierarchicalLayout

java.lang.Object
  extended by com.mindfusion.diagramming.AbstractLayout
      extended by com.mindfusion.diagramming.HierarchicalLayout

public class HierarchicalLayout
extends AbstractLayout

Performs hierarchical layout on simple, connected, level-planar graphs. The hierarchical layout places vertices on predefined levels, such that if the source graph is level-planar it is guaranteed that all edges will have a single segment and will not intersect. A planar graph is considered level-planar if it is still possible to draw it without edge intersections when its vertices are positioned on predefined levels.


Constructor Summary
HierarchicalLayout()
          Initializes a new instance of the HierarchicalLayout class.
 
Method Summary
 boolean arrange(Diagram diagram, DiagramItemList items)
          Applies the layout on the specified subset of items from the specified Diagram instance.
 float getLevelDistance()
          Gets the distance between adjecent levels in the hierarchical layout.
 float getLinkBendFactor()
          Gets the bending factor of links.
 int getOrientation()
          Gets a the orientation of the arranged graph.
 void setLevelDistance(float value)
          Sets the distance between adjecent levels in the hierarchical layout.
 void setLinkBendFactor(float value)
          Sets the bending factor of links.
 void setOrientation(int value)
          Sets a the orientation of the arranged graph.
 
Methods inherited from class com.mindfusion.diagramming.AbstractLayout
arrange, getAnchoring, getKeepGroupLayout, getLayoutLink, getLayoutNode, getMargins, getMultipleGraphsPlacement, getProgress, removeMidleSegmentPoint, setAnchoring, setKeepGroupLayout, setLayoutLink, setLayoutNode, setMargins, setMultipleGraphsPlacement, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchicalLayout

public HierarchicalLayout()
Initializes a new instance of the HierarchicalLayout class.

Method Detail

arrange

public boolean arrange(Diagram diagram,
                       DiagramItemList items)
Applies the layout on the specified subset of items from the specified Diagram instance.

Specified by:
arrange in class AbstractLayout
Parameters:
diagram - The Diagram that should be arranged.
items - A collection of nodes and links from diagram that define the subgraph to arrange.
Returns:
This method always returns true.

getOrientation

public int getOrientation()
Gets a the orientation of the arranged graph.

Returns:
One of the Orientation constants.

setOrientation

public void setOrientation(int value)
Sets a the orientation of the arranged graph.

Parameters:
value - One of the Orientation constants.

getLevelDistance

public float getLevelDistance()
Gets the distance between adjecent levels in the hierarchical layout.


setLevelDistance

public void setLevelDistance(float value)
Sets the distance between adjecent levels in the hierarchical layout.


getLinkBendFactor

public float getLinkBendFactor()
Gets the bending factor of links.


setLinkBendFactor

public void setLinkBendFactor(float value)
Sets the bending factor of links. A value of 1 indicates that the links should not bend. A value less than 1 indicates that the links should bend towards the geometric center of the graph. A value greater than 1 indicates that the links should bend outwards.