Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to rebuild DiagramLinks with Anchor points (Read 1631 times)
SeppiK
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: May 15th, 2008
How to rebuild DiagramLinks with Anchor points
May 15th, 2008 at 3:05pm
Print Post  
Hello together,

At first I save the TableNodes from the diagram in XML.
I save the position x,y and the child node.

Now my problem is to rebuild the diagram, because one of my Nodetype use AnchorPoints.
In usual case one DigramLink has an AnchorPoint as Origin an a child node as Destination.

When I want to rebuild this Diagram I attempt rebuild the RowCollection of the node with the AnchorPoints.

Here is some Code:

Code
Select All
// if all all Nodes from xml parsed, iterate about hits collection an add ellements to Diagram.Items
DiagramItemsCollection items

foreach (FollowElement fsuccessor in  FollowElementList) {
			  row = new Row(thisNode);
			  if (successor is $RIGHT$) {
				$RIGHT$ r = ($RIGHT$) successor;
				$draw following Node$

				DiagramLink l = new DiagramLink(MFDiagram, thisNode, follower);
				row.OutgoingLinks.Add(l);
				items.Add(l);
			  }
		    }
		    thisNode.Rows.Add(row);
 



It exist one AnchorPoint per row.
After rebuilt all DiagramLink have the first AnchorPoint in first row as Origin.
Actually the DiagramLinks must have differnt AnchorPoints. They also begin in differnt row of the TableNode.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to rebuild DiagramLinks with Anchor points
Reply #1 - May 16th, 2008 at 7:28am
Print Post  
Hi,

Assuming you are starting with an empty TableNode, replace the body of that loop with

thisNode.AddRow();
MFDiagram.Factory.CreateDiagramLink(thisNode, thisNode.RowCount - 1, follower);

and remove the "thisNode.Rows.Add(row);" line.

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


I love YaBB 1G - SP1!

Posts: 17
Joined: May 15th, 2008
Re: How to rebuild DiagramLinks with Anchor points
Reply #2 - May 16th, 2008 at 7:56am
Print Post  
Hi Stoyo,

Thanks for your help.
Your example solve my problem.

Now it rocks.

Best regards

Seppi
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint