Class Node<TNodeData, TLinkData>
Default implementation of the Node<TNodeData, TLinkData> interface.
Inheritance
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.Windows.Diagrams.Core.dll
Syntax
public class Node<TNodeData, TLinkData> : Object, INode<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> where TNodeData : new()
where TLinkData : new()
Type Parameters
TNodeData
The type of the payload. |
TLinkData
The type of the link data. |
Constructors
Node()
Node(Int32, Boolean)
Initializes a new instance of the Node<TNodeData, TLinkData> class.
Declaration
public Node(int id, bool isDirected)
Parameters
System.Int32
id
The identifier. |
System.Boolean
isDirected
If set to |
Node(IShape)
Initializes a new instance of the Node<TNodeData, TLinkData> class.
Declaration
public Node(IShape shape)
Parameters
IShape
shape
The shape this node is based on. |
Node(IShape, Boolean)
Initializes a new instance of the Node<TNodeData, TLinkData> class.
Declaration
public Node(IShape shape, bool isDirected)
Parameters
IShape
shape
The shape. |
System.Boolean
isDirected
If set to |
Properties
AllLinks
Gets all the links of this node.
Declaration
public IList<Edge<TNodeData, TLinkData>> AllLinks { get; }
Property Value
System.Collections.Generic.IList<Edge<TNodeData, TLinkData>>
|
Implements
AssociatedShape
Get the shape associated with this layout shape.
Declaration
public IShape AssociatedShape { get; protected set; }
Property Value
IShape
|
BoundingRectangle
Gets or sets the bounding rectangle of the shape.
Declaration
public Rect BoundingRectangle { get; set; }
Property Value
System.Windows.Rect
|
Implements
Center
Gets or sets the geometric center of this ControlShape.
Declaration
public Point Center { get; set; }
Property Value
System.Windows.Point
|
Children
Gets the children nodes attached to this node.
Declaration
public IEnumerable<Node<TNodeData, TLinkData>> Children { get; }
Property Value
System.Collections.Generic.IEnumerable<Node<TNodeData, TLinkData>>
The children collection. |
Implements
Remarks
See Also
Data
Gets or sets the data or payload carried by this node.
Declaration
public TNodeData Data { get; set; }
Property Value
TNodeData
The data. |
Degree
Returns the total number of links attached.
Declaration
public int Degree { get; }
Property Value
System.Int32
|
Implements
See Also
Id
Gets or sets Id.
Declaration
public int Id { get; set; }
Property Value
System.Int32
|
Implements
Incoming
Get the node's incoming links.
Declaration
public IList<Edge<TNodeData, TLinkData>> Incoming { get; protected set; }
Property Value
System.Collections.Generic.IList<Edge<TNodeData, TLinkData>>
|
Implements
Remarks
- If the node is directed (i.e.
IsDirected = true
) then this collection is the same as the AllLinks collection. - Do not add links to this collection but use the AddLink(TNode, TNode) method in order to update the related properties (AllLinks, Outgoing...).
See Also
IsDirected
Gets whether this node's links are directed.
Declaration
public bool IsDirected { get; set; }
Property Value
System.Boolean
|
Implements
See Also
IsRoot
Gets or sets whether this node is a tree-root.
Declaration
public bool IsRoot { get; set; }
Property Value
System.Boolean
|
Implements
Remarks
This property only makes sense in a tree-context. Use a spanning tree algorithm to extract a tree from a generic graph if necessary.
IsVirtual
Gets or sets whether this node maps to a container or a collection of physical shapes.
Declaration
public bool IsVirtual { get; set; }
Property Value
System.Boolean
|
Neighbors
Declaration
public IEnumerable<Node<TNodeData, TLinkData>> Neighbors { get; }
Property Value
System.Collections.Generic.IEnumerable<Node<TNodeData, TLinkData>>
All the neighbors nodes of this node. |
Implements
See Also
Outgoing
Get the node's outgoing links.
Declaration
public IList<Edge<TNodeData, TLinkData>> Outgoing { get; set; }
Property Value
System.Collections.Generic.IList<Edge<TNodeData, TLinkData>>
|
Implements
Remarks
- If the node is directed (i.e.
IsDirected = true
) then this collection is the same as the AllLinks collection. - Do not add links to this collection but use the AddLink(TNode, TNode) method in order to update the related properties (AllLinks, Outgoing...).
See Also
Parents
Gets the parent nodes attached to this node.
Declaration
public IEnumerable<Node<TNodeData, TLinkData>> Parents { get; }
Property Value
System.Collections.Generic.IEnumerable<Node<TNodeData, TLinkData>>
The parent collection. |
Implements
Remarks
See Also
Methods
AddIncomingEdge(Edge<TNodeData, TLinkData>)
Adds an incoming link.
Declaration
public void AddIncomingEdge(Edge<TNodeData, TLinkData> edge)
Parameters
Edge<TNodeData, TLinkData>
edge
The link to add. |
Implements
AddOutgoingEdge(Edge<TNodeData, TLinkData>)
Adds an outgoing link.
Declaration
public void AddOutgoingEdge(Edge<TNodeData, TLinkData> edge)
Parameters
Edge<TNodeData, TLinkData>
edge
The link to add. |
Implements
Clone()
Returns a (shallow) copy of this node.
Declaration
public Node<TNodeData, TLinkData> Clone()
Returns
Node<TNodeData, TLinkData>
Returns a copy of this node, including the references of incoming and outgoing edges. It does not however clone beyond these collections. |
Implements
GetBoundsFromAssociatedShape()
Gets the bounds from the associated shape, if possible.
Declaration
public void GetBoundsFromAssociatedShape()
GetCenterFromAssociatedShape()
Gets the bounds from the associated shape.
Declaration
public void GetCenterFromAssociatedShape()
RemoveIncomingEdge(Edge<TNodeData, TLinkData>)
Removes an incoming edge.
Declaration
public void RemoveIncomingEdge(Edge<TNodeData, TLinkData> edge)
Parameters
Edge<TNodeData, TLinkData>
edge
The edge to remove. |
Implements
RemoveLink(Edge<TNodeData, TLinkData>)
Removes a link.
Declaration
public void RemoveLink(Edge<TNodeData, TLinkData> link)
Parameters
Edge<TNodeData, TLinkData>
link
The link. |
Implements
RemoveOutgoingEdge(Edge<TNodeData, TLinkData>)
Removes the given outgoing edge.
Declaration
public void RemoveOutgoingEdge(Edge<TNodeData, TLinkData> edge)
Parameters
Edge<TNodeData, TLinkData>
edge
The edge to remove. |
Implements
TransferBoundsToAssociatedShape()
Transfers the bounds to the associated shape, if possible.
Declaration
public void TransferBoundsToAssociatedShape()
TransferCenterToAssociatedShape()
Transfers the center to the associated shape, if possible.
Declaration
public void TransferCenterToAssociatedShape()