The base class for all layout algorithms.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Diagrams.Core.dll
Type Parameters:
TNodeData
TLinkData
Syntax:
public abstract class LayoutBase<TNodeData, TLinkData> where TNodeData : new() where TLinkData : new()
Inheritance: objectLayoutBase<TNodeData, TLinkData>
Derived Classes:
Constructors
Initializes a new instance of the LayoutBase<TNodeData, TLinkData> class.
protected LayoutBase()
Methods
Builds the container hierarchy with the virtual root holding the top-containers. If no containers are present this will return null.
Organizes the components in a grid.
protected void GridLayoutComponents(IEnumerable<Graph<TNodeData, TLinkData>> components, double maxWidth, Size margin, Size componentsMargin)
The components.
maxWidthdoubleThe width of the grid.
marginSizeThe margin or offset from the top and left of the surface for the collection of components.
componentsMarginSizeThe individual components margin.
Iterates the container layout to the child containers by organizing first the lowest level containers up to the given container.
protected void IterateContainerLayout(Node<ContainerGraph<TNodeData, TLinkData>, object> containerGraphNode, object settings, ref List<Node<TNodeData, TLinkData>> result)
The container to organize, including its children.
settingsobjectThe settings to use.
resultList<Node<TNodeData, TLinkData>>Layout of the specified container without iterating into possible children containers.
public abstract void Layout(ContainerGraph<TNodeData, TLinkData> containerGraph, object settings)
The container to be organized.
settingsobjectThe settings.
Moves the diagram to the computed offset.
protected Point MoveToCurrentOffset(GraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> layoutGraph, Point extra, bool moveLinks = false)
The graph which has been laid out.
extraPointAn extra offset.
moveLinksboolIf set to true the links will be moved as well.
Point
Moves the component to the given offset.
protected Point MoveToOffset(GraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> layoutGraph, Size offset, bool moveLinks = false)
The layout graph.
offsetSizeThe offset.
moveLinksboolIf set to true links will be moved as well.
Point