[Serializable()] public class GoLink : GoStroke, IGoGraphPart, IGoIdentifiablePart, IGoLink, IGoRoutable
[Serializable()] public class GoLink : GoStroke, IGoGraphPart, IGoIdentifiablePart, IGoLink, IGoRoutable
A link does not own either port to which it is connected -- ports are normally owned by nodes. Ports hold references to the links that are connected to them -- they do not own the links.
The appearance of a link is determined by the stroke GoStroke.Style, by the GoShape.Pen, as well as by various link properties. Any filled arrowheads are painted by the GoShape.Brush. Many examples are presented in the User Guide.
The path of a link is determined by the points in its stroke, as plotted by CalculateStroke. For links of GoStroke.Style GoStrokeStyle.Bezier, it takes the GoStroke.Curviness into account to automatically give the link a curve.
When the link is Orthogonal, it is common to set the style to RoundedLine. Then the GoStroke.Curviness property controls the size of the corners in the link.
Whenever either port is moved (normally because the port's parent node moved), CalculateStroke is called again. By default this will calculate all of the stroke points again. However, if you set the AdjustingStyle property, CalculateStroke will take the old path into account in calculating the new path.
GoBasicNode node1 = new GoBasicNode(); node1.LabelSpot = GoObject.Middle; node1.Text = "basic node 1"; node1.Shape.BrushColor = Color.LightGreen; node1.Location = new PointF(75, 50); goView1.Document.Add(node1); GoBasicNode node2 = new GoBasicNode(); node2.LabelSpot = GoObject.Middle; node2.Text = "basic node 2"; node2.Shape.BrushColor = Color.LightYellow; node2.Location = new PointF(200, 50); goView1.Document.Add(node2); GoLink link = new GoLink(); link.ToArrow = true; link.FromPort = node1.Port; link.ToPort = node2.Port; goView1.Document.Add(link);