Class LayoutBase<TNodeData, TLinkData>
The base class for all layout algorithms.
Inheritance
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 |
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 |
Returns
System.Windows.Point
|