Round link in TSimpleGraph

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

Round link in TSimpleGraph

Postby lukaszp92 » October 6th, 2015, 8:21 pm

Hello,
i have a question.
How can i write a graph that looks like:
Image

I wrote the code:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
  Node: TRectangularNode;
  Link: TGraphLink;
  FGraph : TSimpleGraph;
  i : Integer;
begin

  NodeList.Free;
  NodeList:= TGraphObjectList.Create();
  LinkList.Free;
  LinkList:= TGraphObjectList.Create;

  FGraph := TSimpleGraph.Create(Self);
  FGraph.SetBounds(10, 10, 400, 400);
  FGraph.BeginUpdate;

for I := 0 to 4 do
begin
  Node := TRectangularNode.Create(FGraph);
  if ( (i mod 2)=0 ) then
  begin

    Node.SetBounds(1, 10 +(i*30), 10, 30);
    Node.Brush.Color := clgreen;
    Node.Alignment:=taCenter;
  end
  else
    Node.SetBounds(1+(i*30), 10, 10, 30);

   NodeList.Add(Node);
   if ( (i mod 2)=0 ) then
     NodeList.Items[i].Text := '0'
   else
   NodeList.Items[i].Text := '1';
end;
  FGraph.CommandMode:=(cmEdit);
  for I := 0 to 3 do
  begin

      Link := TGraphLink.Create(FGraph);
      Link.Link(FGraph.Objects[0], FGraph.Objects[i+1]);
      LinkList.Add(Link);
      LinkList.Items[i].Text := IntToStr(i);

  end;
  Link.Font.Height := 15;

  FGraph.LockLinks := True;
  FGraph.EndUpdate;
  FGraph.Parent := Self;
end;


Now the two links overlap.,.
How do i write in code, link like this one the highest and the lowest in the picture (round links).

Please help me.
lukaszp92
Member
Member
 
Posts: 1
Joined: October 6th, 2015, 7:56 pm

Re: Round link in TSimpleGraph

Postby Kambiz » October 17th, 2015, 8:45 am

Hi,

Please check out the following link:
http://extgraph.sourceforge.net/
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron