Class Line
Line node that contains endpoints and control points. Can be used as connector.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Diagram
Assembly: Syncfusion.Diagram.Base.dll
Syntax
public class Line : LineBase, IUnitIndependent, IDispatchNodeEvents, ISerializable, INode, ICloneable, IServiceReferenceHolder, IServiceReferenceProvider, IPropertyObserver, IPropertyContainer, IServiceProvider, IGraphNode, IDeserializationCallback, IDisposable, IEndPointContainer, IGraphEdge
Constructors
Line()
Initializes a new instance of the Line class.
Declaration
public Line()
Line(Line)
Initializes a new instance of the Line class.
Declaration
public Line(Line src)
Parameters
Type | Name | Description |
---|---|---|
Line | src | The Line instance. |
Line(PointF, PointF)
Initializes a new instance of the Line class.
Declaration
public Line(PointF ptStart, PointF ptEnd)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | ptStart | The start point. |
System.Drawing.PointF | ptEnd | The end point. |
Line(PointF, PointF, MeasureUnits)
Initializes a new instance of the Line class.
Declaration
public Line(PointF ptStart, PointF ptEnd, MeasureUnits measureUnits)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | ptStart | The start point. |
System.Drawing.PointF | ptEnd | The end point. |
MeasureUnits | measureUnits | Specifies points measure units. |
Line(PointF[])
Initializes a new instance of the Line class.
Declaration
public Line(PointF[] pts)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF[] | pts | The array of points. |
Line(PointF[], MeasureUnits)
Initializes a new instance of the Line class.
Declaration
public Line(PointF[] pts, MeasureUnits measureUnits)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF[] | pts | The array of points. |
MeasureUnits | measureUnits | Specifies points measure units. |
Line(SerializationInfo, StreamingContext)
Initializes a new instance of the Line class.
Declaration
protected Line(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | The serialization Info. |
System.Runtime.Serialization.StreamingContext | context | The streaming context. |
Fields
m_endPointHead
Head end point.
Declaration
protected HeadEndPoint m_endPointHead
Field Value
Type |
---|
HeadEndPoint |
m_endPointTail
Tail end point.
Declaration
protected TailEndPoint m_endPointTail
Field Value
Type |
---|
TailEndPoint |
m_lineSegments
Collection of segments with bridges.
Declaration
protected ArrayList m_lineSegments
Field Value
Type |
---|
System.Collections.ArrayList |
Properties
ConnectorState
Gets or sets the state of the connector.
Declaration
public ConnectorState ConnectorState { get; set; }
Property Value
Type | Description |
---|---|
ConnectorState | The state of the connector. |
EdgeWeight
Gets weight value associated with the edge.
Declaration
public int EdgeWeight { get; }
Property Value
Type |
---|
System.Int32 |
FlipX
Gets or sets a value indicating whether [flip X].
Declaration
public override bool FlipX { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Overrides
FlipY
Gets or sets a value indicating whether [flip Y].
Declaration
public override bool FlipY { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Overrides
FromNode
Gets node connected to the tail of the edge.
Declaration
public IGraphNode FromNode { get; }
Property Value
Type |
---|
IGraphNode |
HeadEndPoint
Gets the head end point handle.
Declaration
public EndPoint HeadEndPoint { get; }
Property Value
Type | Description |
---|---|
EndPoint | The head end point. |
LineSegments
Gets the line segments list.
Declaration
protected ArrayList LineSegments { get; }
Property Value
Type | Description |
---|---|
System.Collections.ArrayList | The line segments. |
RotationAngle
Gets or sets the rotation angle.
Declaration
public override float RotationAngle { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The rotation angle. |
Overrides
TailEndPoint
Gets the tail end point handle.
Declaration
public EndPoint TailEndPoint { get; }
Property Value
Type | Description |
---|---|
EndPoint | The tail end point. |
ToNode
Gets node connected to the head of the edge.
Declaration
public IGraphNode ToNode { get; }
Property Value
Type |
---|
IGraphNode |
Methods
CanDrawControlPoints()
Determines whether this node can draw control points.
Declaration
public override bool CanDrawControlPoints()
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
CanEditControlPoint()
Determines whether this node can edit control points.
Declaration
public override bool CanEditControlPoint()
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
CanEditSegment()
Determines whether this node can edit segments.
Declaration
public override bool CanEditSegment()
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
CanEditVertexPoint()
Determines whether this node can edit vertex points.
Declaration
public override bool CanEditVertexPoint()
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
CanMoveHandle(IHandle, PointF)
Determines whether this node allow move it handle.
Declaration
public override bool CanMoveHandle(IHandle handle, PointF ptNewLocation)
Parameters
Type | Name | Description |
---|---|---|
IHandle | handle | The handle to move. |
System.Drawing.PointF | ptNewLocation | The new endpoint location to check. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
ChangeFlipX(Boolean)
Called after change the flipX value.
Declaration
protected override void ChangeFlipX(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | New flip x value. |
Overrides
ChangeFlipY(Boolean)
Called after change the flipY value.
Declaration
protected override void ChangeFlipY(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | New flip y value. |
Overrides
ChangeRotationBy(Single)
Called after change the rotation by give angle.
Declaration
protected override void ChangeRotationBy(float fRotationChange)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fRotationChange | The rotation angle offset. |
Overrides
CheckNewPinPoint(PointF, MeasureUnits)
Checks the new pin point.
Declaration
protected override bool CheckNewPinPoint(PointF ptPinPoint, MeasureUnits unit)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | ptPinPoint | The pin point. |
MeasureUnits | unit | The unit. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Clone()
Clones this instance.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | The cloned object |
Overrides
ContainsHandle(IHandle)
Determines whether the node contains specific handle.
Declaration
public override bool ContainsHandle(IHandle handle)
Parameters
Type | Name | Description |
---|---|---|
IHandle | handle | The handle. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
CreateLogicalGraphicsPath(PointF[])
Creates node's path with given array of points.
Declaration
protected override GraphicsPath CreateLogicalGraphicsPath(PointF[] pts)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF[] | pts | Points to create path from. |
Returns
Type | Description |
---|---|
System.Drawing.Drawing2D.GraphicsPath | Created GraphicsPath, otherwise null. |
Overrides
Dispose()
Declaration
public override void Dispose()
Overrides
DoHandleMoveRelated(IHandle, SizeF)
Perfoms additional changes on handle move.
Declaration
protected override void DoHandleMoveRelated(IHandle handleMoved, SizeF szOffset)
Parameters
Type | Name | Description |
---|---|---|
IHandle | handleMoved | The moved handle . |
System.Drawing.SizeF | szOffset | The move offset. |
Overrides
DoMoveRelatedActions(Single, Single)
Called when node is moved.
Declaration
protected override void DoMoveRelatedActions(float fX, float fY)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fX | The x offset. |
System.Single | fY | The y offset. |
Overrides
DoPinOffsetRelatedActions(SizeF, SizeF)
Performs additional changes on pin offset value changed.
Declaration
protected override void DoPinOffsetRelatedActions(SizeF szOldPinOffset, SizeF szNewPinOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.SizeF | szOldPinOffset | The old pin offset value. |
System.Drawing.SizeF | szNewPinOffset | The new pin offset value. |
Overrides
DoSizeRelatedActions(SizeF, SizeF)
Used to update child nodes sizes.
Declaration
protected override void DoSizeRelatedActions(SizeF szOldSize, SizeF szNewSize)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.SizeF | szOldSize | The old size. |
System.Drawing.SizeF | szNewSize | The new size. |
Overrides
GetLineSegmentAt(Int32)
Gets the line segment by its index.
Declaration
public override LineSegment GetLineSegmentAt(int nSegmentIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nSegmentIndex | Index of the segment. |
Returns
Type | Description |
---|---|
LineSegment | The line segment |
Overrides
GetObjectData(SerializationInfo, StreamingContext)
Gets the object data.
Declaration
protected override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | The serialization Info. |
System.Runtime.Serialization.StreamingContext | context | The streaming context. |
Overrides
GetPathPoints()
Retrieves array of points needed to construct node's GraphicsPath.
Declaration
protected override PointF[] GetPathPoints()
Returns
Type | Description |
---|---|
System.Drawing.PointF[] | The path points. |
Overrides
GetPropertyContainer(String)
Gets the property container.
Declaration
protected override object GetPropertyContainer(string strPropertyContainerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | strPropertyContainerName | Name of the STR property container. |
Returns
Type | Description |
---|---|
System.Object | Property container value. |
Overrides
IsConnected()
Determines whether this line is connected.
Declaration
protected virtual bool IsConnected()
Returns
Type | Description |
---|---|
System.Boolean |
|
IsHeadConnected()
Determines whether HeadEdnPoints is connected
Declaration
protected virtual bool IsHeadConnected()
Returns
Type | Description |
---|---|
System.Boolean | true - if HeadEndPoints is connected otherwise - false. |
IsNodeEntering(IGraphNode)
Determines if this edge is entering the given node.
Declaration
public bool IsNodeEntering(IGraphNode graphNode)
Parameters
Type | Name | Description |
---|---|---|
IGraphNode | graphNode | Node to test. |
Returns
Type | Description |
---|---|
System.Boolean | True if edge is entering the given node. |
IsNodeLeaving(IGraphNode)
Determines if this edge is leaving the given node.
Declaration
public bool IsNodeLeaving(IGraphNode graphNode)
Parameters
Type | Name | Description |
---|---|---|
IGraphNode | graphNode | Node to test. |
Returns
Type | Description |
---|---|
System.Boolean | True if edge is leaving the given node. |
IsTailConnected()
Determines whether TailEdnPoints is connected
Declaration
protected virtual bool IsTailConnected()
Returns
Type | Description |
---|---|
System.Boolean | true - if TailEndPoints is connected otherwise - false. |
MergeControlPoints()
Merges the control points.
Declaration
protected void MergeControlPoints()
MergeControlPoints(ref PointF[])
Merges the control points.
Declaration
protected void MergeControlPoints(ref PointF[] ptsNew)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF[] | ptsNew | The points. |
OnNodeScaleChanged(String)
Called when node scale factor is changed.
Declaration
protected override void OnNodeScaleChanged(string strPropertyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | strPropertyName | The property name that change scale factor value. |
Overrides
SetEndPoints(PointF[])
Updates EndPoints locations.
Declaration
protected void SetEndPoints(PointF[] ptsPath)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF[] | ptsPath | New path points. |
UpdateBoundsInfo(RectangleF)
Updates the Pin position, pin offset and size from new bounds rectangle.
Declaration
protected override void UpdateBoundsInfo(RectangleF rcBounds)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rcBounds | The updated bounds. |
Overrides
UpdateGraphicsPath(PointF[])
Updates node's GraphicsPath on given array of points.
Declaration
protected override void UpdateGraphicsPath(PointF[] pts)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF[] | pts | The new path points array. |
Overrides
UpdateReferences(IServiceReferenceProvider)
Updates the references.
Declaration
public override void UpdateReferences(IServiceReferenceProvider provider)
Parameters
Type | Name | Description |
---|---|---|
IServiceReferenceProvider | provider | The provider. |
Overrides
UpdateSegments()
Updates connector's segments from PathPoints.
Declaration
protected void UpdateSegments()
UpdateSegments(PointF[])
Updates connector's segments.
Declaration
protected virtual void UpdateSegments(PointF[] ptsPoints)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF[] | ptsPoints | The array of points. |