ILinksModel
A model that supports directed link relationships between nodes, with the relationship information stored in separate link data structures.
Implements: IDiagramModel
Properties
public IEnumerable LinksSource { get; set; }
value = iLinksModel.LinksSource
iLinksModel.LinksSource = value
The collection of link data objects
public ValidCycle ValidCycle { get; set; }
value = iLinksModel.ValidCycle
iLinksModel.ValidCycle = value
This property controls the overall graph structure that may be drawn.
public ValidUnconnectedLinks ValidUnconnectedLinks { get; set; }
value = iLinksModel.ValidUnconnectedLinks
iLinksModel.ValidUnconnectedLinks = value
This property controls whether link data must always connect to node data at both ends of the link.
Methods
public void AddLink(object linkdata)
iLinksModel.AddLink(linkdata)
Add a link data to LinksSource.
- linkdata
public object AddLinkCopy(object linkdata)
result = iLinksModel.AddLinkCopy(linkdata)
Add a copy of a link data to this model.
- linkdata
Returns: the newly copied link data
public void DoLinkAdded(object linkdata)
iLinksModel.DoLinkAdded(linkdata)
This method should be called when a link data has been added to the LinksSource collection.
- linkdata
public void DoLinkLabelChanged(object linkdata)
iLinksModel.DoLinkLabelChanged(linkdata)
This method must be called when any "label" node is added, removed, or replaced.
- linkdata
public void DoLinkPortsChanged(object linkdata)
iLinksModel.DoLinkPortsChanged(linkdata)
This method must be called when either the "from" or the "to" node (or port) has changed.
- linkdata
- a link data
public void DoLinkRemoved(object linkdata)
iLinksModel.DoLinkRemoved(linkdata)
This method should be called when a link data has been removed from the LinksSource collection.
- linkdata
public string GetCategoryForLink(object linkdata)
result = iLinksModel.GetCategoryForLink(linkdata)
To help distinguish between different kinds of links, each link has a "category" that is just a string.
- linkdata
Returns: the default category is the empty string
public IEnumerable<object> GetFromLinksForNode(object nodedata)
result = iLinksModel.GetFromLinksForNode(nodedata)
Find all links coming into a given node.
- nodedata
Returns: a sequence of link data
public object GetFromNodeForLink(object linkdata)
result = iLinksModel.GetFromNodeForLink(linkdata)
Returns the node from which a link comes.
- linkdata
Returns: a node data
public object GetFromParameterForLink(object linkdata)
result = iLinksModel.GetFromParameterForLink(linkdata)
Returns any "from" port parameter information.
- linkdata
Returns: the port parameter data
public bool GetHasLabeledLinkForNode(object nodedata)
result = iLinksModel.GetHasLabeledLinkForNode(nodedata)
This predicate is true if the given node data is associated with a link data as a label.
- nodedata
- a node data that is a "label"
public bool GetHasLabelNodeForLink(object linkdata)
result = iLinksModel.GetHasLabelNodeForLink(linkdata)
This predicate is true if the given link data has a node label.
- linkdata
- a link data
public bool GetIsLinkLabelForNode(object nodedata)
result = iLinksModel.GetIsLinkLabelForNode(nodedata)
This predicate is true if the given node data acts as a label for a link.
- nodedata
- a node data
public object GetLabeledLinkForNode(object nodedata)
result = iLinksModel.GetLabeledLinkForNode(nodedata)
Find the link data with which a label node is associated, if any.
- nodedata
- a node data that is a "label"
Returns: a link data, or null if there is none
public object GetLabelNodeForLink(object linkdata)
result = iLinksModel.GetLabelNodeForLink(linkdata)
Find the node data that is the label for a link, if there is one.
- linkdata
- a link data
Returns: a node data, or null if there is none
public IEnumerable<object> GetLinksBetweenNodes(object fromdata, object fromparam, object todata, object toparam)
result = iLinksModel.GetLinksBetweenNodes(fromdata, fromparam, todata, toparam)
Find all links connecting two nodes/ports in one direction.
- fromdata
- a node key identifying the node data from which the link comes
- fromparam
- an optional value identifying which port on the "from" node the link is connected to
- todata
- a node key identify the node data to which the link goes
- toparam
- an optional value identifying which port on the "to" node the link is connected to
Returns: a sequence of link data
public IEnumerable<object> GetLinksForNode(object nodedata, Predicate<object> predicate)
result = iLinksModel.GetLinksForNode(nodedata, predicate)
Find all links connected to a node that satisfy a given predicate.
- nodedata
- predicate
- the predicate takes a single argument, the link data
Returns: a sequence of link data
public IEnumerable<object> GetLinksForNode(object nodedata)
result = iLinksModel.GetLinksForNode(nodedata)
Find all links connected to a node in either direction.
- nodedata
Returns: a sequence of link data
public IEnumerable<object> GetToLinksForNode(object nodedata)
result = iLinksModel.GetToLinksForNode(nodedata)
Find all links going out of a given node.
- nodedata
Returns: a sequence of link data
public object GetToNodeForLink(object linkdata)
result = iLinksModel.GetToNodeForLink(linkdata)
Returns the node to which a link goes.
- linkdata
Returns: a node data
public object GetToParameterForLink(object linkdata)
result = iLinksModel.GetToParameterForLink(linkdata)
Returns any "to" port parameter information.
- linkdata
Returns: the port parameter data
public bool IsLinkData(object linkdata)
result = iLinksModel.IsLinkData(linkdata)
This predicate is true if the linkdata is in the LinksSource collection.
- linkdata
public bool IsLinkType(object linkdata)
result = iLinksModel.IsLinkType(linkdata)
This predicate is true if the object is non-null and is of a type that the model accepts for link data.
- linkdata
public bool IsRelinkValid(object newfromdata, object newfromparam, object newtodata, object newtoparam, object oldlinkdata)
result = iLinksModel.IsRelinkValid(newfromdata, newfromparam, newtodata, newtoparam, oldlinkdata)
This predicate is true if changing an existing link between two nodes/ports would result in a valid graph
- newfromdata
- a node key identifying the node data from which the new link would come
- newfromparam
- an optional value identifying which port on the "from" node the link would be connected to
- newtodata
- a node key identify the node data to which the new link would go
- newtoparam
- an optional value identifying which port on the "to" node the link would be connected to
- oldlinkdata
- an existing link that would be deleted
public void RemoveLink(object linkdata)
iLinksModel.RemoveLink(linkdata)
Remove a link data from LinksSource.
- linkdata
public void SetLinkFromPort(object linkdata, object nodedata, object portparam)
iLinksModel.SetLinkFromPort(linkdata, nodedata, portparam)
Set the "from" node and port information for a link data.
- linkdata
- the link data being modified
- nodedata
- a node data
- portparam
public void SetLinkLabel(object linkdata, object labelnodedata)
iLinksModel.SetLinkLabel(linkdata, labelnodedata)
Change the "label" node data for a link data.
- linkdata
- the link data being modified
- labelnodedata
- the new node data that is a "label"; may be null to remove the label
public void SetLinkToPort(object linkdata, object nodedata, object portparam)
iLinksModel.SetLinkToPort(linkdata, nodedata, portparam)
Set the "to" node and port information for a link data.
- linkdata
- the link data being modified
- nodedata
- a node data
- portparam