Class
TreeLayoutProcessor

The tree layout algorithms.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

cs-api-definition
public class TreeLayoutProcessor

Inheritance: objectTreeLayoutProcessor

Constructors

TreeLayoutProcessor(TreeLayoutSettings)

Initializes a new instance of the TreeLayoutProcessor class.

Declaration

cs-api-definition
public TreeLayoutProcessor(TreeLayoutSettings settings = null)

Parameters

settings

TreeLayoutSettings

The settings.

Properties

LayoutCenter

Gets or sets the center of the current layout.

Declaration

cs-api-definition
public Node<TreeLayoutData, object> LayoutCenter { get; set; }

Property Value

Node<TreeLayoutData, object>

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

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static void DepthFirstTraversal(Node<TreeLayoutData, object> node, Action<Node<TreeLayoutData, object>> action)

Parameters

node

Node<TreeLayoutData, object>

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

cs-api-definition
public void Layout(Graph<TreeLayoutData, object> treeGraph, Node<TreeLayoutData, object> root, TreeLayoutSettings layoutSettings = null)

Parameters

treeGraph

Graph<TreeLayoutData, object>

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

root

Node<TreeLayoutData, object>

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

layoutSettings

TreeLayoutSettings

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

cs-api-definition
[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
public Size Measure(Node<TreeLayoutData, object> node, Size givenSize)

Parameters

node

Node<TreeLayoutData, object>

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

cs-api-definition
public void SetChildrenDirection(Node<TreeLayoutData, object> node, TreeDirection direction, bool includeStart)

Parameters

node

Node<TreeLayoutData, object>

The shape.

direction

TreeDirection

The direction.

includeStart

bool

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

cs-api-definition
public void SetChildrenLayout(Node<TreeLayoutData, object> node, ChildrenLayout layout, bool includeStart, int startFromLevel = 0)

Parameters

node

Node<TreeLayoutData, object>

The shape.

layout

ChildrenLayout

The layout.

includeStart

bool

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

startFromLevel

int

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

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static IList<Node<TreeLayoutData, object>> Subtree(Node<TreeLayoutData, object> shape)

Parameters

shape

Node<TreeLayoutData, object>

The shape.

Returns

IList<Node<TreeLayoutData, object>>