Class
Edge<TNodeData, TLinkData>

Generic implementation of the IEdge<TNode, TLink> interface.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Type Parameters:

TNodeData

TLinkData

Syntax:

cs-api-definition
public class Edge<TNodeData, TLinkData> : IEdge<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> where TNodeData : new() where TLinkData : new()

Inheritance: objectEdge<TNodeData, TLinkData>

Implements: IEdge<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>

Constructors

Edge()

Initializes a new instance of the Edge<TNodeData, TLinkData> class.

Declaration

cs-api-definition
public Edge()

Edge(IConnection)

Initializes a new instance of the Edge<TNodeData, TLinkData> class.

Declaration

cs-api-definition
public Edge(IConnection connection)

Parameters

connection

IConnection

The connection on which this link is based.

Properties

Connection

Gets the associated IConnection object. If this is a virtual edge this connection is null.

Declaration

cs-api-definition
public IConnection Connection { get; }

Property Value

IConnection

Id

Gets or sets identifier.

Declaration

cs-api-definition
public int Id { get; set; }

Property Value

int

Implements IEdge<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>.Id

IsDirected

Gets or sets whether there is an intrinsic direction. If not, this means the edge can be traversed in both directions.

Declaration

cs-api-definition
public bool IsDirected { get; set; }

Property Value

bool

IsReversed

Gets whether link has been reversed (using the Reverse() method).

Declaration

cs-api-definition
public bool IsReversed { get; }

Property Value

bool

IsVirtual

Gets whether this edge represents a logical link rather than one derived from a single connection. For instance, a virtual edge is necessary when multiple connections exist between containers and the working graph needs a single edge for the layout process.

Declaration

cs-api-definition
public bool IsVirtual { get; }

Property Value

bool

NumberOfVirtualNodes

Gets or sets the number of virtual nodes which have been inserted during the process of breaking layer-crossing links. This is specific to the Sugiyama layout.

Declaration

cs-api-definition
public int NumberOfVirtualNodes { get; set; }

Property Value

int

Points

Gets or sets the points defining the link.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public IList<Point> Points { get; set; }

Property Value

IList<Point>

Remarks

This also defines eventually the IConnection visual if it's a polyline or some other multi-point visual.

PropertyBag

Gets or sets the dictionary of runtime/layout properties.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public Dictionary<object, object> PropertyBag { get; set; }

Property Value

Dictionary<object, object>

SegmentIndex

Gets or sets index of the segment.

Declaration

cs-api-definition
public int SegmentIndex { get; set; }

Property Value

int

Sink

Gets the destination (target, end) node of this link.

Declaration

cs-api-definition
public Node<TNodeData, TLinkData> Sink { get; set; }

Property Value

Node<TNodeData, TLinkData>

Implements IEdge<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>.Sink

Source

Gets the source (origin, start) node of this link.

Declaration

cs-api-definition
public Node<TNodeData, TLinkData> Source { get; set; }

Property Value

Node<TNodeData, TLinkData>

Implements IEdge<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>.Source

Weight

Gets the weight of this link.

Declaration

cs-api-definition
public double Weight { get; set; }

Property Value

double

Implements IEdge<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>.Weight

Methods

Clone()

Returns a (shallow) clone of this link.

Declaration

cs-api-definition
public Edge<TNodeData, TLinkData> Clone()

Returns

Edge<TNodeData, TLinkData>

A clone of this link.

Implements IEdge<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>.Clone()

Remarks

The following properties are being cloned:

GetBounds()

Gets the bounding rectangle of this entity.

Declaration

cs-api-definition
public Rect GetBounds()

Returns

Rect

GetComplementaryNode(INode<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>)

Returns the opposite or complementary node of the given one.

Declaration

cs-api-definition
public Node<TNodeData, TLinkData> GetComplementaryNode(INode<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> node)

Parameters

node

INode<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>

The node whose complement is looked for.

Returns

Node<TNodeData, TLinkData>

null if the node is not part of this link, otherwise the opposite or complementary node with respect to this link.

Implements IEdge<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>.GetComplementaryNode(INode<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>)

GetOppositeNode(Node<TNodeData, TLinkData>)

Returns the node at the opposite end of the link.

Declaration

cs-api-definition
public Node<TNodeData, TLinkData> GetOppositeNode(Node<TNodeData, TLinkData> node)

Parameters

node

Node<TNodeData, TLinkData>

The a Node.

Returns

Node<TNodeData, TLinkData>

Reverse()

Reverses the direction of this link.

Declaration

cs-api-definition
public void Reverse()

Implements IEdge<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>.Reverse()

SetPoints(IEnumerable<Point>)

Sets the control points (Points) of this link.

Declaration

cs-api-definition
public void SetPoints(IEnumerable<Point> points)

Parameters

points

IEnumerable<Point>

The points defining this link.