Class SerpentineLayout
- Namespace
- Northwoods.Go.Layouts.Extensions
- Assembly
- SerpentineWinForms.dll
A custom Layout that lays out a chain of nodes in a snake-like fashion.
public class SerpentineLayout : Layout
- Inheritance
-
SerpentineLayout
- Inherited Members
Remarks
This layout assumes the graph is a chain of Nodes, positioning nodes in horizontal rows back and forth, alternating between left-to-right and right-to-left within the Wrap limit. Spacing controls the distance between nodes. LeftSpot and RightSpot determine the Spots to use for the FromSpot and ToSpot.
When this layout is the Diagram.Layout, it is automatically invalidated when the viewport changes size.
Constructors
SerpentineLayout()
Constructs a SerpentineLayout and sets the IsViewportSized property to true.
public SerpentineLayout()
Properties
LeftSpot
Gets or sets the Spot to use on the left side of a Node.
public Spot LeftSpot { get; set; }
Property Value
Remarks
The default value is Left.
RightSpot
Gets or sets the Spot to use on the right side of a Node.
public Spot RightSpot { get; set; }
Property Value
Remarks
The default value is Right.
Root
Gets or sets the starting node of the sequence.
public Node Root { get; set; }
Property Value
Remarks
The default value is null, which causes the layout to look for a node without any incoming links.
Spacing
Gets or sets the Size whose width specifies the horizontal space between nodes and whose height specifies the minimum vertical space between nodes.
public Size Spacing { get; set; }
Property Value
Remarks
The default value is 30x30.
Wrap
Gets or sets the total width of the layout.
public double Wrap { get; set; }
Property Value
Remarks
The default value is NaN, which for Layouts means that it uses the ViewportBounds.
Methods
DoLayout(IEnumerable<Part>)
This method actually positions all of the Nodes, assuming that the ordering of the nodes is given by a single link from one node to the next.
public override void DoLayout(IEnumerable<Part> coll = null)
Parameters
coll
IEnumerable<Part>A collection of Parts.