New to Telerik UI for WPFStart a free 30-day trial

The tree layout algorithms.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

C#
public class TreeLayoutProcessor

Inheritance: objectTreeLayoutProcessor

Constructors

Initializes a new instance of the TreeLayoutProcessor class.

C#
public TreeLayoutProcessor(TreeLayoutSettings settings = null)
Parameters:settingsTreeLayoutSettings

The settings.

Properties

Gets or sets the center of the current layout.

C#
public Node<TreeLayoutData, object> LayoutCenter { get; set; }
Property Value:

The center.

Methods

A standard depth first traversal (DFT) of the tree starting from the given node.

C#
public static void DepthFirstTraversal(Node<TreeLayoutData, object> node, Action<Node<TreeLayoutData, object>> action)
Parameters:nodeNode<TreeLayoutData, object>

The node.

actionAction<Node<TreeLayoutData, object>>

The action.

Performs a tree-layout of the tree-graph.

C#
public void Layout(Graph<TreeLayoutData, object> treeGraph, Node<TreeLayoutData, object> root, TreeLayoutSettings layoutSettings = null)
Parameters:treeGraphGraph<TreeLayoutData, object>

A graph which is supposedly a tree. If not, please use the spanning tree algorithms (Kruskal or Prim).

rootNode<TreeLayoutData, object>

The root to be used as the starting point for the layout pass..

layoutSettingsTreeLayoutSettings

The tree layout settings. If none supplied defaults will be used, see the TreeLayoutSettings.

Returns the actual size of the node. The given size is the allowed space wherein the node can lay out itself.

C#
public Size Measure(Node<TreeLayoutData, object> node, Size givenSize)
Parameters:nodeNode<TreeLayoutData, object>

The node.

givenSizeSize

The maximum space given to this node wherein it can organize itself.

Returns:

Size

Sets the children direction recursively.

C#
public void SetChildrenDirection(Node<TreeLayoutData, object> node, TreeDirection direction, bool includeStart)
Parameters:nodeNode<TreeLayoutData, object>

The shape.

directionTreeDirection

The direction.

includeStartbool

If set to true the given start shape will be set as well..

Sets the children layout recursively.

C#
public void SetChildrenLayout(Node<TreeLayoutData, object> node, ChildrenLayout layout, bool includeStart, int startFromLevel = 0)
Parameters:nodeNode<TreeLayoutData, object>

The shape.

layoutChildrenLayout

The layout.

includeStartbool

If set to true the given start shape will be set as well.

startFromLevelint

The layout is assigned starting from a certain level on, the node node being level zero.

Gets the tree with the given shape as root of the tree.

C#
public static IList<Node<TreeLayoutData, object>> Subtree(Node<TreeLayoutData, object> shape)
Parameters:shapeNode<TreeLayoutData, object>

The shape.

Returns:

IList<Node<TreeLayoutData, object>>