Class ConnectorBase
Template connector class that contains Head and Tail EndPoints, CompassHeadings, Segments and Bridges.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Diagram
Assembly: Syncfusion.Diagram.Base.dll
Syntax
public abstract class ConnectorBase : LineBase, IUnitIndependent, IDispatchNodeEvents, ISerializable, INode, ICloneable, IServiceReferenceHolder, IServiceReferenceProvider, IPropertyObserver, IPropertyContainer, IServiceProvider, IGraphNode, IDeserializationCallback, IDisposable, IEndPointContainer, IGraphEdge
Constructors
ConnectorBase(ConnectorBase)
Initializes a new instance of the ConnectorBase class.
Declaration
public ConnectorBase(ConnectorBase src)
Parameters
Type | Name | Description |
---|---|---|
ConnectorBase | src | The source connector. |
ConnectorBase(PointF, PointF)
Initializes a new instance of the ConnectorBase class.
Declaration
public ConnectorBase(PointF ptStart, PointF ptEnd)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | ptStart | The tail end point location. |
System.Drawing.PointF | ptEnd | The head end point location. |
ConnectorBase(PointF, PointF, MeasureUnits)
Initializes a new instance of the ConnectorBase class.
Declaration
public ConnectorBase(PointF ptStart, PointF ptEnd, MeasureUnits measureUnits)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | ptStart | The tail end point location. |
System.Drawing.PointF | ptEnd | The head end point location. |
MeasureUnits | measureUnits | Specifies points measure units. |
ConnectorBase(SerializationInfo, StreamingContext)
Initializes a new instance of the ConnectorBase class.
Declaration
protected ConnectorBase(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_bLineBridgingEnabled
Flag used to enable line bridging.
Declaration
protected bool m_bLineBridgingEnabled
Field Value
Type |
---|
System.Boolean |
m_bLockHandleMove
Flag what use for lock handle moving while EditStyle.AllowRotate = false;
Declaration
protected bool m_bLockHandleMove
Field Value
Type |
---|
System.Boolean |
m_fLineBridgeSize
Line bridge size.
Declaration
protected float m_fLineBridgeSize
Field Value
Type |
---|
System.Single |
m_lineSegments
Collection of segments with bridges.
Declaration
protected ArrayList m_lineSegments
Field Value
Type |
---|
System.Collections.ArrayList |
Properties
BridgeStyle
Gets or sets bridge style.
Declaration
public BridgeStyle BridgeStyle { get; set; }
Property Value
Type |
---|
BridgeStyle |
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 |
EnableRoundedCorner
Gets or sets the edge type of the connector.
Declaration
public bool EnableRoundedCorner { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The edge of the connector. |
FlipX
Gets or sets a value indicating whether flip X is enable.
Declaration
public override bool FlipX { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Overrides
FlipY
Gets or sets a value indicating whether flip Y is enable.
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.
Declaration
public EndPoint HeadEndPoint { get; }
Property Value
Type | Description |
---|---|
EndPoint | The head end point. |
HeadingDistance
Gets or sets the distance from heading to obstacle node.
Declaration
public float HeadingDistance { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The heading distance. |
HeadingHead
Gets or sets the heading head.
Declaration
public CompassHeading HeadingHead { get; set; }
Property Value
Type | Description |
---|---|
CompassHeading | The heading head. |
HeadingTail
Gets or sets the heading tail.
Declaration
public CompassHeading HeadingTail { get; set; }
Property Value
Type | Description |
---|---|
CompassHeading | The heading tail. |
LineBridgingEnabled
Gets or sets a value indicating whether line bridging is enabled for this connector only.
Declaration
public bool LineBridgingEnabled { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
Used by BridgeManager to check if current segment can contains bridges.
LineRoutingEnabled
Gets or sets a value indicating whether that line routing is enabled.
Declaration
public bool LineRoutingEnabled { get; set; }
Property Value
Type |
---|
System.Boolean |
LineSegments
Gets the collection of ConnectorLineSegment items.
Declaration
public ArrayList LineSegments { get; }
Property Value
Type | Description |
---|---|
System.Collections.ArrayList | The collection of ConnectorLineSegment items. |
RotationAngle
Gets or sets the rotation angle.
Declaration
public override float RotationAngle { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The rotation angle in range [ -180; 180 ]. |
Overrides
Remarks
Rotation angle saved in rotation range [ -180; 180 ] But on set this property new rotation angle must be in range [ 0; 360 ]
TailEndPoint
Gets the tail end point.
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
AccumulateRefreshRect(ref RectangleF)
Accumulates the refresh rect.
Declaration
protected override void AccumulateRefreshRect(ref RectangleF rcRefresh)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rcRefresh | The refresh rectangle. |
Overrides
BeforeMoveSegment(ref PointF[])
Helper method used to perform additional actions before updating path node data. Used by Connectors to merge control points.
Declaration
protected override void BeforeMoveSegment(ref PointF[] ptsNew)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF[] | ptsNew | The new path points. |
Overrides
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 flipX 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 flipY 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
CheckLineSegmentIntersect(PointF, PointF, PointF, PointF, out PointF)
Checks the line segment intersect.
Declaration
protected bool CheckLineSegmentIntersect(PointF ptStart1, PointF ptEnd1, PointF ptStart2, PointF ptEnd2, out PointF ptIntersect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | ptStart1 | The first start point. |
System.Drawing.PointF | ptEnd1 | The first end point. |
System.Drawing.PointF | ptStart2 | The second start point. |
System.Drawing.PointF | ptEnd2 | The pt second end point. |
System.Drawing.PointF | ptIntersect | The intersection point. |
Returns
Type | Description |
---|---|
System.Boolean | true, if line segment intersect. |
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
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)
Performs additional changes on pin position changed.
Declaration
protected override void DoMoveRelatedActions(float fX, float fY)
Parameters
Type | Name | Description |
---|---|---|
System.Single | fX | The pin offset by x axis. |
System.Single | fY | The pin offset by y axis. |
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
DrawPath(Graphics)
Draws line in graphics.
Declaration
protected override void DrawPath(Graphics gfx)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | gfx | The graphics. |
Overrides
DrawSegment(Graphics, ConnectorLineSegment)
Draws the line segment to specified graphics.
Declaration
protected void DrawSegment(Graphics gfx, ConnectorLineSegment segment)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | gfx | Graphics to on. |
ConnectorLineSegment | segment | The segment. |
EventSink_PropertyChanged(PropertyChangedEventArgs)
Raise when node property is changed.
Declaration
protected override void EventSink_PropertyChanged(PropertyChangedEventArgs evtArgs)
Parameters
Type | Name | Description |
---|---|---|
PropertyChangedEventArgs | evtArgs | The PropertyChangedEventArgs instance containing the event data. |
Overrides
FinishSetPoints()
Finishes the set points operation.
Declaration
protected override void FinishSetPoints()
Overrides
GetAllConnectors(ICompositeNode)
Gets all connectors in composite nodes in deep.
Declaration
protected NodeCollection GetAllConnectors(ICompositeNode composite)
Parameters
Type | Name | Description |
---|---|---|
ICompositeNode | composite | The composite node. |
Returns
Type | Description |
---|---|
NodeCollection | The NodeCollection. |
GetAllPorts(ICompositeNode)
Declaration
protected ArrayList GetAllPorts(ICompositeNode composite)
Parameters
Type | Name | Description |
---|---|---|
ICompositeNode | composite |
Returns
Type |
---|
System.Collections.ArrayList |
GetHandleAt(Int32)
Gets the handle by index of pathPoints.
Declaration
protected IHandle GetHandleAt(int nIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nIndex | Index of handle in points list. |
Returns
Type | Description |
---|---|
IHandle | Handle by path points index. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | If index less that zero or larger that handle count. |
GetLineBridgeSize()
Gets the length of the line bridge.
Declaration
protected float GetLineBridgeSize()
Returns
Type | Description |
---|---|
System.Single | The bridge length. |
GetLineSegmentAt(Int32)
Gets the line segment by it index.
Declaration
public override LineSegment GetLineSegmentAt(int nSegmentIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nSegmentIndex | Index of the segment. |
Returns
Type | Description |
---|---|
LineSegment | 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[] | Array of 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 | The property container object. |
Overrides
InsertPoint(Int32, PointF)
Inserts the point to the PathNode at the specified index.
Declaration
public override void InsertPoint(int ptIdx, PointF val)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | ptIdx | The zero-based index ar which |
System.Drawing.PointF | val | The point in local coordinates. |
Overrides
IntersectSegmentWith(Int32, NodeCollection)
Updates the connectors intersecting.
Declaration
public void IntersectSegmentWith(int segmentIndex, NodeCollection nodes)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | segmentIndex | Index of the segment. |
NodeCollection | nodes | The collection of Node items. |
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. |
IsLineBridgingEnabled()
Determines whether the Model.Bridging is enable.
Declaration
protected bool IsLineBridgingEnabled()
Returns
Type | Description |
---|---|
System.Boolean |
|
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. |
LengthenLine(PointF, ref PointF, Single)
Draws the curve for the line
Declaration
public void LengthenLine(PointF startPoint, ref PointF endPoint, float pixelCount)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF | startPoint | start point |
System.Drawing.PointF | endPoint | end point |
System.Single | pixelCount | curve radius |
MergeControlPoints()
Merges the control points placed in line.
Declaration
protected virtual void MergeControlPoints()
Remarks
Used with handle moving.
MergeControlPoints(ref PointF[])
Merges the control points placed in line.
Declaration
protected virtual void MergeControlPoints(ref PointF[] ptsNew)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF[] | ptsNew | The new points. |
Remarks
Used with line segment move.
MergeNearBridges(ref Int32, Bridge, ConnectorLineSegment, ref Single, ref Single)
Merges the near bridges.
Declaration
protected void MergeNearBridges(ref int nIndex, Bridge bridge, ConnectorLineSegment lineSegment, ref float fOffsetHelper, ref float fBridgeOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nIndex | Index of the bridge. |
Bridge | bridge | The bridge. |
ConnectorLineSegment | lineSegment | The line segment. |
System.Single | fOffsetHelper | The bridegSize helper. |
System.Single | fBridgeOffset | The bridge offset. |
MoveEndPoints(SizeF)
Moves the end points to given offset.
Declaration
protected virtual void MoveEndPoints(SizeF szOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.SizeF | szOffset | The move offset. |
MoveSegment(Int32, SizeF)
Moves the segment to given offset.
Declaration
protected override PointF[] MoveSegment(int lineSegmentIndex, SizeF szOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lineSegmentIndex | Index of the line segment. |
System.Drawing.SizeF | szOffset | The segment move offset. |
Returns
Type | Description |
---|---|
System.Drawing.PointF[] | The points to offset. |
Overrides
OnDeserialized()
Called when node is deserialized.
Declaration
protected override void OnDeserialized()
Overrides
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
OnParentChanged()
Called when parent changed.
Declaration
protected override void OnParentChanged()
Overrides
OnParentChanging()
Called when parent property changed.
Declaration
protected override void OnParentChanging()
Overrides
SetControlPoints(PointF[], Int32)
Set the control points location.
Declaration
protected override void SetControlPoints(PointF[] ptsPath, int nStartIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF[] | ptsPath | The points path. |
System.Int32 | nStartIndex | Index of the beginning control path points. |
Overrides
SetEndPoints(PointF[])
Updates EndPoints locations.
Declaration
protected void SetEndPoints(PointF[] ptsPath)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.PointF[] | ptsPath | New path points. |
SyncEndPointsWithPort()
Synchronize head and tail end points with port if need.
Declaration
protected virtual void SyncEndPointsWithPort()
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.
Declaration
protected virtual void UpdateSegments()
Remarks
Update using path points and related handles to create new segments.