ClassEdge<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:
public class Edge<TNodeData, TLinkData> : IEdge<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> where TNodeData : new() where TLinkData : new()
Inheritance: objectEdge<TNodeData, TLinkData>
Implements:
Constructors
Edge()
Initializes a new instance of the Edge<TNodeData, TLinkData> class.
Declaration
public Edge()
Edge(IConnection)
Initializes a new instance of the Edge<TNodeData, TLinkData> class.
Declaration
public Edge(IConnection connection)
Parameters
connection
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.
Id
Gets or sets identifier.
IsDirected
Gets or sets whether there is an intrinsic direction. If not, this means the edge can be traversed in both directions.
IsReversed
Gets whether link has been reversed (using the Reverse() method).
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.
NumberOfVirtualNodes
Gets or sets the number of virtual nodes which have been inserted during the process of breaking layer-crossing links.
Points
Gets or sets the points defining the link.
Declaration
[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
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public Dictionary<object, object> PropertyBag { get; set; }
Property Value
SegmentIndex
Gets or sets index of the segment.
Sink
Gets the destination (target, end) node of this link.
Declaration
public Node<TNodeData, TLinkData> Sink { get; set; }
Property Value
Node<TNodeData, TLinkData>
Implements
Methods
Clone()
Returns a (shallow) clone of this link.
Declaration
public Edge<TNodeData, TLinkData> Clone()
Returns
Edge<TNodeData, TLinkData>
A clone of this link.
Implements
Remarks
The following properties are being cloned:
- The identifier (Id)
- The weight (Weight)
- The segment index (SegmentIndex)
- The points (Points).
GetBounds()
Gets the bounding rectangle of this entity.
Declaration
public Rect GetBounds()
Returns
Rect
GetComplementaryNode(INode<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>)
Returns the opposite or complementary node of the given one.
Declaration
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
GetOppositeNode(Node<TNodeData, TLinkData>)
Returns the node at the opposite end of the link.
Reverse()
Reverses the direction of this link.
Declaration
public void Reverse()
Implements
SetPoints(IEnumerable<Point>)
Sets the control points (Points) of this link.
Declaration
public void SetPoints(IEnumerable<Point> points)
Parameters
points
IEnumerable<Point>
The points defining this link.