Returns the edge specified by the index. The
Edge and EdgeCount property provide access to all the edges leading from, or out of, this node.
Namespace: GGraph
Delphi
|
public
property Edge[ Index: Integer ]: TGGraphEdge read GetEdge;
|
Parameters
Index
Type: Integer
Property Value
Type: TGGraphEdge
The following example prints the names of all the nodes that Node1 points to (assumes directed graph):
Delphi
|
var
i: Integer;
begin
if Node1.Graph.Directed then
for i := 0 to Node1.EdgeCount - 1 do
ListBox1.Items.Add( '--> ' + Node1.Edge[i].ToNode.Caption )
else
for i := 0 to Node1.EdgeCount - 1 do
if Node1.Edge[i].FromNode = Self then
ListBox1.Items.Add( '--> ' + Node1.Edge[i].ToNode.Caption )
else
ListBox1.Items.Add( '--> ' + Node1.Edge[i].FromNode.Caption )
end;
|