Page Index Toggle Pages: [1] 2 3 ... 21 Send TopicPrint
Locked Topic Link between two nodes (Read 129568 times)
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Link between two nodes
May 21st, 2014 at 6:15am
 
Hello,
Can you tell me how to change the length of connectors between two nodes?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #1 - May 21st, 2014 at 7:04am
 
You can change link's length only indirectly by assigning new coordinates to link.ControlPoints. If you simply need the link to take shortest possible path between nodes, set its Shape to Polyline and SegmentCount = 1.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #2 - May 21st, 2014 at 8:24am
 
I want consistent length of connectors between all nodes, here problem is some connectors are small and some are large.
here is code,
ShapeNode SrcShapeNode = DiagramView1.Diagram.FindNodeById(SourceNode) as ShapeNode;
ShapeNode DestShapeNode = DiagramView1.Diagram.FindNodeById(DestinationNode) as ShapeNode;
DiagramLink d = factory.CreateDiagramLink(SrcShapeNode, DestShapeNode);
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #3 - May 21st, 2014 at 8:29am
 
So you want to place nodes at equal distances, try running SpringLayout.Arrange to achieve that.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #4 - May 21st, 2014 at 8:48am
 
Its working properly but some nodes are not visible cz of this change. and another one thing length is consistent but its to long i want consistent with short.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #5 - May 21st, 2014 at 9:36am
 
Quote:
Its working properly but some nodes are not visible cz of this change.


Call diagram.ResizeToFitItems after Arrange.

Quote:
and another one thing length is consistent but its to long i want consistent with short.


Set smaller SpringLayout.NodeDistance value.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #6 - May 22nd, 2014 at 9:18am
 
Can u tell me how to change color of connectors, I am using following code.
DiagramLink d1 = factory.CreateDiagramLink(SrcShapeNodeLoop,DestShapeNodeLoop);
d1.Brush = new MindFusion.Drawing.SolidBrush(System.Drawing.Color.Red);
But its not applying Red color.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #7 - May 22nd, 2014 at 9:39am
 
Try with d1.Pen = new MindFusion.Drawing.Pen(System.Drawing.Color.Red, 0); The Brush property is used to fill arrowheads if they are closed shapes.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #8 - May 22nd, 2014 at 9:55am
 
Thanks Its working can u tell me some list of syntax so that I can get help from there.

In programmers guide proper syntax is not present.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #9 - May 22nd, 2014 at 10:39am
 
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #10 - May 22nd, 2014 at 11:44am
 
I am using following layout still some nodes are not visible.

MindFusion.Diagramming.Layout.CascadeLayout l2 = new MindFusion.Diagramming.Layout.CascadeLayout();
            l2.Arrange(diagram);
            diagram.ResizeToFitItems(10);
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #11 - May 22nd, 2014 at 12:42pm
 
Do you mean there are nodes outside of the diagram boundaries, and you cannot scroll to them?
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #12 - May 22nd, 2014 at 12:49pm
 
yes right
  
Back to top
 
IP Logged
 
shrinivas
Full Member
***
Offline


I Love MindFusion!

Posts: 169
Joined: May 21st, 2014
Re: Link between two nodes
Reply #13 - May 22nd, 2014 at 1:36pm
 
How to give solid arrowhead for connectors?

How to change text orientation i.e vertical to horizontal and vice versa for text on connectors?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link between two nodes
Reply #14 - May 22nd, 2014 at 5:59pm
 
Quote:
yes right


Check if you aren't setting a smaller diagram.Bounds value later; I can't see any way the ResizeToFit method would not set large enough diagram area.

Quote:
How to give solid arrowhead for connectors?


Set link.HeadShape = Arrowheads.Triangle (or another closed shape from the enum).

Quote:
How to change text orientation i.e vertical to horizontal and vice versa for text on connectors.


If you are using ImageMap or JavaApplet mode, you could set link.TextStyle = LinkTextStyle.Rotate and the text will automatically follow the link direction. This is not supported in ClientSideMode=Canvas at this time.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 ... 21
Send TopicPrint