Class
LayoutBase<TNodeData, TLinkData>

The base class for all layout algorithms.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Type Parameters:

TNodeData

TLinkData

Syntax:

cs-api-definition
public abstract class LayoutBase<TNodeData, TLinkData> where TNodeData : new() where TLinkData : new()

Inheritance: objectLayoutBase<TNodeData, TLinkData>

Derived Classes: SugiyamaLayoutTreeLayout

Constructors

LayoutBase()

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

Declaration

cs-api-definition
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

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes")]
public static Graph<TNodeData, TLinkData> BuildContainerHierarchy(IGraph diagramControl)

Parameters

diagramControl

IGraph

The diagram control.

Returns

Graph<TNodeData, TLinkData>

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

Organizes the components in a grid.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
protected void GridLayoutComponents(IEnumerable<Graph<TNodeData, TLinkData>> components, double maxWidth, Size margin, Size componentsMargin)

Parameters

components

IEnumerable<Graph<TNodeData, TLinkData>>

The components.

maxWidth

double

The width of the grid.

margin

Size

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

componentsMargin

Size

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

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")]
protected void IterateContainerLayout(Node<ContainerGraph<TNodeData, TLinkData>, object> containerGraphNode, object settings, ref List<Node<TNodeData, TLinkData>> result)

Parameters

containerGraphNode

Node<ContainerGraph<TNodeData, TLinkData>, object>

The container to organize, including its children.

settings

object

The settings to use.

result

List<Node<TNodeData, TLinkData>>

Layout(ContainerGraph<TNodeData, TLinkData>, object)

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

Declaration

cs-api-definition
public abstract void Layout(ContainerGraph<TNodeData, TLinkData> containerGraph, object settings)

Parameters

containerGraph

ContainerGraph<TNodeData, TLinkData>

The container to be organized.

settings

object

The settings.

Layout(IGraph, object)

Starts a layout pass.

Declaration

cs-api-definition
public abstract void Layout(IGraph diagramControl, object settings)

Parameters

diagramControl

IGraph

The diagram control which needs to be laid out.

settings

object

The parameterization of the layout.

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

Moves the diagram to the computed offset.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
protected Point MoveToCurrentOffset(GraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> layoutGraph, Point extra, bool moveLinks = false)

Parameters

layoutGraph

GraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>

The graph which has been laid out.

extra

Point

An extra offset.

moveLinks

bool

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

Returns

Point

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

Moves the component to the given offset.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
protected Point MoveToOffset(GraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> layoutGraph, Size offset, bool moveLinks = false)

Parameters

layoutGraph

GraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>

The layout graph.

offset

Size

The offset.

moveLinks

bool

If set to true links will be moved as well.

Returns

Point