ClassLayoutBase<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:
public abstract class LayoutBase<TNodeData, TLinkData> where TNodeData : new() where TLinkData : new()
Inheritance: objectLayoutBase<TNodeData, TLinkData>
Derived Classes:
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.
GridLayoutComponents(IEnumerable<Graph<TNodeData, TLinkData>>, double, Size, Size)
Organizes the components in a grid.
Declaration
[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
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
[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
The settings to use.
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
ContainerGraph<TNodeData, TLinkData>
The container to be organized.
settings
The settings.
Layout(IGraph, object)
Starts a layout pass.
MoveToCurrentOffset(GraphBase<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>, Point, bool)
Moves the diagram to the computed offset.
Declaration
[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
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
[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
If set to true links will be moved as well.
Returns
Point