skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class LayoutBase<TNodeData, TLinkData>

The base class for all layout algorithms.

Inheritance
System.Object
LayoutBase<TNodeData, TLinkData>
SugiyamaLayout
TreeLayout
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.Windows.Diagrams.Core.dll

Syntax

public abstract class LayoutBase<TNodeData, TLinkData> : Object where TNodeData : new()
    where TLinkData : new()
Type Parameters
TNodeData

TLinkData

Constructors

LayoutBase()

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

Declaration
protected LayoutBase()

Methods

BuildContainerHierarchy(IGraph)

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

Declaration
public static Graph<TNodeData, TLinkData> BuildContainerHierarchy(IGraph diagramControl)
Parameters
IGraph diagramControl

The diagram control.

Returns
Graph<TNodeData, TLinkData>

GridLayoutComponents(IEnumerable<Graph<TNodeData, TLinkData>>, Double, Size, Size)

Organizes the components in a grid.

Declaration
protected void GridLayoutComponents(IEnumerable<Graph<TNodeData, TLinkData>> components, double maxWidth, Size margin, Size componentsMargin)
Parameters
System.Collections.Generic.IEnumerable<Graph<TNodeData, TLinkData>> components

The components.

System.Double maxWidth

The width of the grid.

System.Windows.Size margin

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

System.Windows.Size componentsMargin

The individual components margin.

IterateContainerLayout(Node<ContainerGraph<TNodeData, TLinkData>, Object>, Object, ref List<Node<TNodeData, TLinkData>>)

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

Declaration
protected void IterateContainerLayout(Node<ContainerGraph<TNodeData, TLinkData>, object> containerGraphNode, object settings, ref List<Node<TNodeData, TLinkData>> result)
Parameters
Node<ContainerGraph<TNodeData, TLinkData>, System.Object> containerGraphNode

The container to organize, including its children.

System.Object settings

The settings to use.

System.Collections.Generic.List<Node<TNodeData, TLinkData>> result

Layout(ContainerGraph<TNodeData, TLinkData>, Object)

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

Declaration
public abstract void Layout(ContainerGraph<TNodeData, TLinkData> containerGraph, object settings)
Parameters
ContainerGraph<TNodeData, TLinkData> containerGraph

The container to be organized.

System.Object settings

The settings.

Layout(IGraph, Object)

Starts a layout pass.

Declaration
public abstract void Layout(IGraph diagramControl, object settings)
Parameters
IGraph diagramControl

The diagram control which needs to be laid out.

System.Object settings

The parameterization of the layout.

MoveToCurrentOffset(GraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>, Point, Boolean)

Moves the diagram to the computed offset.

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

The graph which has been laid out.

System.Windows.Point extra

An extra offset.

System.Boolean moveLinks

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

Returns
System.Windows.Point

MoveToOffset(GraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>, Size, Boolean)

Moves the component to the given offset.

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

The layout graph.

System.Windows.Size offset

The offset.

System.Boolean moveLinks

If set to true links will be moved as well.

Returns
System.Windows.Point

Extension Methods

CollectionExtensions.ToEnumerable<T>(T)
EnumerableExtensions.ToEnumerable<T>(T)
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.