Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Link Arrangement (Read 3874 times)
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Link Arrangement
Sep 2nd, 2009 at 6:05am
Print Post  
Hi,

I have sent a sample image at your support id for required link arrangement in my application. Please have a look at it and let us know your suggestion.

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Arrangement
Reply #1 - Sep 2nd, 2009 at 7:23am
Print Post  
There aren't any images attached to the email we've received.

Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Link Arrangement
Reply #2 - Sep 2nd, 2009 at 8:12am
Print Post  
Please check now.

Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Arrangement
Reply #3 - Sep 2nd, 2009 at 5:54pm
Print Post  
Use this method to set the points for each link:

Code
Select All
private void SetLinkPoints(DiagramLink link, params Point[] points)
{
	link.AutoRoute = false;
	link.Style = LinkStyle.Cascading;
	link.ControlPoints.Clear();
	link.ControlPoints.AddRange(points);
	link.UpdateFromPoints(false, true);
}
 



Then handle four cases:
- links in the left column
- links between the left column and the center node
- links in the right column
- links between the right column and the center node

and set the points respectively. E.g. for links in the right column:

Code
Select All
Rect or = link.Origin.Bounds;
Rect dr = link.Destination.Bounds;
float dist = 10;
SetLinkPoints(link,
	new Point(or.Right, or.Top + or.Height / 2),
	new Point(or.Right + dist, or.Top + or.Height / 2),
	new Point(or.Right + dist, dr.Top + dr.Height / 2),
	new Point(dr.Right, dr.Top + dr.Height / 2));
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Link Arrangement
Reply #4 - Sep 7th, 2009 at 10:57am
Print Post  
Hi Stoyan,

Thanks for the snippet. We have some queries regarding this.

1). we have tried to implement it but we are not able to understand where to handle these four cases.
To apply these four cases we need to check for some condition but what will that condition.

2). we are not sure about these two handles. How to right code for them?
•links between the left column and the center node
•links between the right column and the center node

3). we don’t want to move link by their turning point, currently we can move links by their turning points. How we can avoid this?

4). Links should not go inside the node; they should reach till the boundary of the node.

Please suggest on these.

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Arrangement
Reply #5 - Sep 8th, 2009 at 7:56am
Print Post  
Hi Anshul,

1. After arranging the nodes as shown on the image you emailed us, loop over the links and set their points according to the four cases. From the image, I assume you have a center node, a column of nodes on the left of it, and a column on the right. So the condition could be where the current link end points are located relatively to the center node, and whether the center node is one of the link ends.

2. From the left column to the center should look like this:

Code
Select All
Rect or = link.Origin.Bounds;
Rect dr = link.Destination.Bounds;
float dist = dr.Bounds.Width / 4;
float destY = or.Y > dr.Y ? dr.Top : dr.Bottom;
SetLinkPoints(link,
	new Point(or.Right, or.Top + or.Height / 2),
	new Point(or.Right + dist, or.Top + or.Height / 2),
	new Point(or.Right + dist, destY));
 



3. You could set link.Locked = true.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Link Arrangement
Reply #6 - Sep 8th, 2009 at 3:50pm
Print Post  
Hi Stoyan,
Thanks for the reply.

We had sent a sample image to show which type of link arrangement we require. Our Application has dynamic arranment of nodes so the same arrangement (as in image) will not be there everytime. we want if such kind of arrangent is there than diagram should look like same as in the image.

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Arrangement
Reply #7 - Sep 10th, 2009 at 6:11am
Print Post  
So what assumptions should we make from that image? Will the graph be always arranged as a sequence of columns of nodes where each second column contains just one node?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint