Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic two shapenodes link to one shapenode (Read 2789 times)
Green
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Jun 30th, 2011
two shapenodes link to one shapenode
Jan 4th, 2013 at 7:33am
Print Post  
there is a shapenode ,I wish two shapenodes link to the shapenode ,one is dash ,the other is Solid ,but the link can not be Overlapped ,LinkStyle.Cascading ,what should I do?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: two shapenodes link to one shapenode
Reply #1 - Jan 4th, 2013 at 10:39am
Print Post  
How are these three nodes located relatively to each other? You might assign different positions to the links end points to avoid overlapping the segments adjacent to nodes. To avoid overlapping internal segments, try calling Diagram.RouteAllLinks().

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Green
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Jun 30th, 2011
Re: two shapenodes link to one shapenode
Reply #2 - Jan 5th, 2013 at 1:07am
Print Post  
thank you ! but how can I assign different positions to the links end points ?
  

QQ__20130105090722.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: two shapenodes link to one shapenode
Reply #3 - Jan 7th, 2013 at 7:05am
Print Post  
After applying the layout you are using, call this method for all nodes, assuming links have three segments:

Code
Select All
void OffsetDashedLinks(DiagramNode node)
{
	foreach (DiagramLink link in node.OutgoingLinks)
	{
		if (link.Pen.DashStyle != DashStyle.Solid)
		{
			var points = link.ControlPoints;
			var n = points.Count - 1;
			var xOffset = (points[0].X > points[n].X) ?
				-1 :	// destination is to the left of origin
				+1;		// destination is to the right of origin
			points[0] = new PointF(points[0].X + xOffset, points[0].Y);
			points[1] = new PointF(points[1].X + xOffset, points[1].Y - 1);
			points[2] = new PointF(points[2].X + xOffset, points[2].Y - 1);
			points[3] = new PointF(points[3].X + xOffset, points[3].Y);
			link.UpdateFromPoints();
		}
	}
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint