Class Edge<TNodeData, TLinkData>
Generic implementation of the IEdge<TNode, TLink> interface.
Inheritance
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.Windows.Diagrams.Core.dll
Syntax
public class Edge<TNodeData, TLinkData> : Object, IEdge<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> where TNodeData : new()
where TLinkData : new()
Type Parameters
TNodeData
|
TLinkData
|
Constructors
Edge()
Edge(IConnection)
Initializes a new instance of the Edge<TNodeData, TLinkData> class.
Declaration
public Edge(IConnection connection)
Parameters
IConnection
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.
Declaration
public IConnection Connection { get; }
Property Value
IConnection
|
Id
Gets or sets identifier.
Declaration
public int Id { get; set; }
Property Value
System.Int32
|
Implements
IsDirected
Gets or sets whether there is an intrinsic direction. If not, this means the edge can be traversed in both directions.
Declaration
public bool IsDirected { get; set; }
Property Value
System.Boolean
|
IsReversed
Gets whether link has been reversed (using the Reverse() method).
Declaration
public bool IsReversed { get; }
Property Value
System.Boolean
|
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
public bool IsVirtual { get; }
Property Value
System.Boolean
|
NumberOfVirtualNodes
Gets or sets the number of virtual nodes which have been inserted during the process of breaking layer-crossing links.
Declaration
public int NumberOfVirtualNodes { get; set; }
Property Value
System.Int32
|
Points
Gets or sets the points defining the link.
Declaration
public IList<Point> Points { get; set; }
Property Value
System.Collections.Generic.IList<System.Windows.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
public Dictionary<object, object> PropertyBag { get; set; }
Property Value
System.Collections.Generic.Dictionary<System.Object, System.Object>
|
SegmentIndex
Gets or sets index of the segment.
Declaration
public int SegmentIndex { get; set; }
Property Value
System.Int32
|
Sink
Gets the destination (target, end) node of this link.
Declaration
public Node<TNodeData, TLinkData> Sink { get; set; }
Property Value
Node<TNodeData, TLinkData>
|
Implements
Source
Gets the source (origin, start) node of this link.
Declaration
public Node<TNodeData, TLinkData> Source { get; set; }
Property Value
Node<TNodeData, TLinkData>
|
Implements
Weight
Gets the weight of this link.
Declaration
public double Weight { get; set; }
Property Value
System.Double
|
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
System.Windows.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
INode<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>>
node
The node whose complement is looked for. |
Returns
Node<TNodeData, TLinkData>
|
Implements
GetOppositeNode(Node<TNodeData, TLinkData>)
Returns the node at the opposite end of the link.
Declaration
public Node<TNodeData, TLinkData> GetOppositeNode(Node<TNodeData, TLinkData> node)
Parameters
Node<TNodeData, TLinkData>
node
The a Node. |
Returns
Node<TNodeData, TLinkData>
|
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
System.Collections.Generic.IEnumerable<System.Windows.Point>
points
The points defining this link. |