ClassNode<TNodeData, TLinkData>
Default implementation of the Node<TNodeData, TLinkData> interface.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Diagrams.Core.dll
Type Parameters:
TNodeData
The type of the payload.
TLinkData
The type of the link data.
Syntax:
public class Node<TNodeData, TLinkData> : INode<Node<TNodeData, TLinkData>, Edge<TNodeData, TLinkData>> where TNodeData : new() where TLinkData : new()
Inheritance: objectNode<TNodeData, TLinkData>
Derived Classes:
Implements:
Constructors
Node()
Initializes a new instance of the Node<TNodeData, TLinkData> class.
Declaration
public Node()
Node(IShape)
Initializes a new instance of the Node<TNodeData, TLinkData> class.
Declaration
public Node(IShape shape)
Parameters
shape
The shape this node is based on.
Node(IShape, bool)
Initializes a new instance of the Node<TNodeData, TLinkData> class.
Node(int, bool)
Initializes a new instance of the Node<TNodeData, TLinkData> class.
Properties
AllLinks
Gets all the links of this node.
AssociatedShape
Get the shape associated with this layout shape.
Declaration
public IShape AssociatedShape { get; protected set; }
Property Value
BoundingRectangle
Gets or sets the bounding rectangle of the shape.
Declaration
public Rect BoundingRectangle { get; set; }
Property Value
Rect
Implements
Center
Gets or sets the geometric center of this ControlShape.
Declaration
public Point Center { get; set; }
Property Value
Point
Children
Gets the children nodes attached to this node.
Declaration
public IEnumerable<Node<TNodeData, TLinkData>> Children { get; }
Property Value
IEnumerable<Node<TNodeData, TLinkData>>
The children collection.
Implements
Remarks
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.
Id
Gets or sets Id.
Incoming
Get the node's incoming links.
Declaration
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public IList<Edge<TNodeData, TLinkData>> Incoming { get; protected set; }
Property Value
Implements
Remarks
IsDirected
Gets whether this node's links are directed.
Declaration
public bool IsDirected { get; set; }
Property Value
true if this instance is directed; otherwise, false.
Implements
IsRoot
Gets or sets whether this node is a tree-root.
Declaration
public bool IsRoot { get; set; }
Property Value
true if this instance is root; otherwise, false.
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.
Neighbors
Declaration
public IEnumerable<Node<TNodeData, TLinkData>> Neighbors { get; }
Property Value
IEnumerable<Node<TNodeData, TLinkData>>
All the neighbors nodes of this node.
Implements
Outgoing
Get the node's outgoing links.
Declaration
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public IList<Edge<TNodeData, TLinkData>> Outgoing { get; set; }
Property Value
Implements
Remarks
Parents
Gets the parent nodes attached to this node.
Declaration
public IEnumerable<Node<TNodeData, TLinkData>> Parents { get; }
Property Value
IEnumerable<Node<TNodeData, TLinkData>>
The parent collection.
Implements
Remarks
Methods
AddIncomingEdge(Edge<TNodeData, TLinkData>)
Adds an incoming link.
Declaration
public void AddIncomingEdge(Edge<TNodeData, TLinkData> edge)
Parameters
edge
Edge<TNodeData, TLinkData>
The link to add.
Implements
AddOutgoingEdge(Edge<TNodeData, TLinkData>)
Adds an outgoing link.
Declaration
public void AddOutgoingEdge(Edge<TNodeData, TLinkData> edge)
Parameters
edge
Edge<TNodeData, TLinkData>
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
Edge<TNodeData, TLinkData>
The edge to remove.
Implements
RemoveLink(Edge<TNodeData, TLinkData>)
Removes a link.
Declaration
public void RemoveLink(Edge<TNodeData, TLinkData> link)
Parameters
link
Edge<TNodeData, TLinkData>
The link.
Implements
RemoveOutgoingEdge(Edge<TNodeData, TLinkData>)
Removes the given outgoing edge.
Declaration
public void RemoveOutgoingEdge(Edge<TNodeData, TLinkData> edge)
Parameters
edge
Edge<TNodeData, TLinkData>
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()