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

The base class for all layout algorithms.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Type Parameters:

TNodeData

TLinkData

Syntax:

C#
public abstract class LayoutBase<TNodeData, TLinkData> where TNodeData : new() where TLinkData : new()

Inheritance: objectLayoutBase<TNodeData, TLinkData>

Derived Classes: SugiyamaLayoutTreeLayout

Constructors

Initializes a new instance of the LayoutBase<TNodeData, TLinkData> class.

C#
protected LayoutBase()

Methods

Builds the container hierarchy with the virtual root holding the top-containers. If no containers are present this will return null.

C#
public static Graph<TNodeData, TLinkData> BuildContainerHierarchy(IGraph diagramControl)
Parameters:diagramControlIGraph

The diagram control.

Returns:

Graph<TNodeData, TLinkData>

Organizes the components in a grid.

C#
protected void GridLayoutComponents(IEnumerable<Graph<TNodeData, TLinkData>> components, double maxWidth, Size margin, Size componentsMargin)
Parameters:componentsIEnumerable<Graph<TNodeData, TLinkData>>

The components.

maxWidthdouble

The width of the grid.

marginSize

The margin or offset from the top and left of the surface for the collection of components.

componentsMarginSize

The individual components margin.

Iterates the container layout to the child containers by organizing first the lowest level containers up to the given container.

C#
protected void IterateContainerLayout(Node<ContainerGraph<TNodeData, TLinkData>, object> containerGraphNode, object settings, ref List<Node<TNodeData, TLinkData>> result)
Parameters:containerGraphNodeNode<ContainerGraph<TNodeData, TLinkData>, object>

The container to organize, including its children.

settingsobject

The settings to use.

resultList<Node<TNodeData, TLinkData>>

Layout of the specified container without iterating into possible children containers.

C#
public abstract void Layout(ContainerGraph<TNodeData, TLinkData> containerGraph, object settings)
Parameters:containerGraphContainerGraph<TNodeData, TLinkData>

The container to be organized.

settingsobject

The settings.

Starts a layout pass.

C#
public abstract void Layout(IGraph diagramControl, object settings)
Parameters:diagramControlIGraph

The diagram control which needs to be laid out.

settingsobject

The parameterization of the layout.

Moves the diagram to the computed offset.

C#
protected Point MoveToCurrentOffset(GraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> layoutGraph, Point extra, bool moveLinks = false)
Parameters:layoutGraphGraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>

The graph which has been laid out.

extraPoint

An extra offset.

moveLinksbool

If set to true the links will be moved as well.

Returns:

Point

Moves the component to the given offset.

C#
protected Point MoveToOffset(GraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> layoutGraph, Size offset, bool moveLinks = false)
Parameters:layoutGraphGraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>

The layout graph.

offsetSize

The offset.

moveLinksbool

If set to true links will be moved as well.

Returns:

Point