Class ParallelLayout
A custom TreeLayout that can be used for laying out stylized flowcharts.
Inheritance
Namespace: Northwoods.Go.Layouts.Extensions
Assembly: ParallelAvalonia.dll
Syntax
public class ParallelLayout : TreeLayout
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:
Declaration
public ParallelLayout()
Properties
MergeNode
This read-only property returns the node that the tree will converge at.
Declaration
public Node MergeNode { get; }
Property Value
Type | Description |
---|---|
Node |
SplitNode
This read-only property returns the node that the tree will extend from.
Declaration
public Node SplitNode { get; }
Property Value
Type | Description |
---|---|
Node |
Methods
CommitLinks()
Routes the links.
Declaration
protected override void CommitLinks()
Overrides
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.
Declaration
public virtual void FindSplitMerge(IEnumerable<TreeVertex> vertexes)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TreeVertex> | vertexes |
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.
Declaration
public virtual bool IsConditional(Node node)
Parameters
Type | Name | Description |
---|---|---|
Node | node |
Returns
Type | Description |
---|---|
bool |
IsMerge(Node)
Overridable predicate for deciding if a Node is a Merge node.
Declaration
public virtual bool IsMerge(Node node)
Parameters
Type | Name | Description |
---|---|---|
Node | node |
Returns
Type | Description |
---|---|
bool |
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.
Declaration
public virtual bool IsSplit(Node node)
Parameters
Type | Name | Description |
---|---|---|
Node | node |
Returns
Type | Description |
---|---|
bool |
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.
Declaration
public virtual bool IsSwitch(Node node)
Parameters
Type | Name | Description |
---|---|---|
Node | node |
Returns
Type | Description |
---|---|
bool |