ClassTreeLayoutProcessor
The tree layout algorithms.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Diagrams.Core.dll
Syntax:
public class TreeLayoutProcessor
Inheritance: objectTreeLayoutProcessor
Constructors
TreeLayoutProcessor(TreeLayoutSettings)
Initializes a new instance of the TreeLayoutProcessor class.
Declaration
public TreeLayoutProcessor(TreeLayoutSettings settings = null)
Parameters
settings
The settings.
Properties
LayoutCenter
Gets or sets the center of the current layout.
Declaration
public Node<TreeLayoutData, object> LayoutCenter { get; set; }
Property Value
The center.
Methods
DepthFirstTraversal(Node<TreeLayoutData, object>, Action<Node<TreeLayoutData, object>>)
A standard depth first traversal (DFT) of the tree starting from the given node.
Declaration
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static void DepthFirstTraversal(Node<TreeLayoutData, object> node, Action<Node<TreeLayoutData, object>> action)
Parameters
node
The node.
action
Action<Node<TreeLayoutData, object>>
The action.
Layout(Graph<TreeLayoutData, object>, Node<TreeLayoutData, object>, TreeLayoutSettings)
Performs a tree-layout of the tree-graph.
Declaration
public void Layout(Graph<TreeLayoutData, object> treeGraph, Node<TreeLayoutData, object> root, TreeLayoutSettings layoutSettings = null)
Parameters
treeGraph
A graph which is supposedly a tree. If not, please use the spanning tree algorithms (Kruskal or Prim).
root
The root to be used as the starting point for the layout pass..
layoutSettings
The tree layout settings. If none supplied defaults will be used, see the TreeLayoutSettings.
Measure(Node<TreeLayoutData, object>, Size)
Returns the actual size of the node. The given size is the allowed space wherein the node can lay out itself.
Declaration
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
public Size Measure(Node<TreeLayoutData, object> node, Size givenSize)
Parameters
node
The node.
givenSize
Size
The maximum space given to this node wherein it can organize itself.
Returns
Size
SetChildrenDirection(Node<TreeLayoutData, object>, TreeDirection, bool)
Sets the children direction recursively.
Declaration
public void SetChildrenDirection(Node<TreeLayoutData, object> node, TreeDirection direction, bool includeStart)
Parameters
node
The shape.
direction
The direction.
includeStart
If set to true the given start shape will be set as well..
SetChildrenLayout(Node<TreeLayoutData, object>, ChildrenLayout, bool, int)
Sets the children layout recursively.
Declaration
public void SetChildrenLayout(Node<TreeLayoutData, object> node, ChildrenLayout layout, bool includeStart, int startFromLevel = 0)
Parameters
node
The shape.
layout
The layout.
includeStart
If set to true the given start shape will be set as well.
startFromLevel
The layout is assigned starting from a certain level on, the node node being level zero.
Subtree(Node<TreeLayoutData, object>)
Gets the tree with the given shape as root of the tree.
Declaration
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static IList<Node<TreeLayoutData, object>> Subtree(Node<TreeLayoutData, object> shape)
Parameters
shape
The shape.
Returns