Class ParallelLayout
- Namespace
- Northwoods.Go.Layouts.Extensions
- Assembly
- ParallelWinForms.dll
A custom TreeLayout that can be used for laying out stylized flowcharts.
public class ParallelLayout : TreeLayout
- Inheritance
-
ParallelLayout
- Inherited Members
Remarks
Each layout requires a single "Split" node and a single "Merge" node. The "Split" node should be the root of a tree-like structure if one excludes links to the "Merge" node. This will position the "Merge" node to line up with the "Split" node.
You can set all of the TreeLayout properties that you like, except that for simplicity this code just works for angle == 0 or angle == 90.
Constructors
ParallelLayout()
Constructs a Parallel layout and sets the following properties:
public ParallelLayout()
Properties
MergeNode
This read-only property returns the node that the tree will converge at.
public Node MergeNode { get; }
Property Value
SplitNode
This read-only property returns the node that the tree will extend from.
public Node SplitNode { get; }
Property Value
Methods
CommitLinks()
Routes the links.
protected override void CommitLinks()
Remarks
This is called by CommitLayout(). This is only called if IsRouting is true. Please read the Introduction page on Extensions for how to override methods and how to call this base method.
- See Also
FindSplitMerge(IEnumerable<TreeVertex>)
Find a Split vertex and a Merge vertex for this layout.
public virtual void FindSplitMerge(IEnumerable<TreeVertex> vertexes)
Parameters
vertexes
IEnumerable<TreeVertex>
Remarks
This signals an error if there is not exactly one Node that IsSplit(Node) and exactly one Node that IsMerge(Node). This can be overridden; any override must set SplitNode and MergeNode.
IsConditional(Node)
Overridable predicate for deciding if a Node is a conditional or "If" type of Split Node expecting to have two links coming out of the sides.
public virtual bool IsConditional(Node node)
Parameters
node
Node
Returns
IsMerge(Node)
Overridable predicate for deciding if a Node is a Merge node.
public virtual bool IsMerge(Node node)
Parameters
node
Node
Returns
Remarks
By default this checks the node's Category to see if it is "Merge", "End", "EndFor", "EndWhile", "EndIf", or "EndSwitch".
IsSplit(Node)
Overridable predicate for deciding if a Node is a Split node.
public virtual bool IsSplit(Node node)
Parameters
node
Node
Returns
Remarks
By default this checks the node's Category to see if it is "Split", "Start", "For", "While", "If", or "Switch".
IsSwitch(Node)
Overridable predicate for deciding if a Node is a "Switch" type of Split Node expecting to have three links coming out of the bottom/right side.
public virtual bool IsSwitch(Node node)
Parameters
node
Node