Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) control the order of the nodes (Read 8208 times)
tzippy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
control the order of the nodes
Feb 19th, 2009 at 2:14pm
Print Post  
Hi,
How can I control the order of the nodes?
For example, I want to add a node between other two nodes, or in the right side of other node, etc.
10X
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: control the order of the nodes
Reply #1 - Feb 19th, 2009 at 2:18pm
Print Post  
Hi,

If you mean the order of child nodes in TreeLayout, this depends on the order of links from parent to child nodes in the parent' OutgoingLinks collection. So you could rearrange OutgoingLinks before applying TreeLayout and will get the child nodes in the same order as the links in that collection.

Stoyan
  
Back to top
 
IP Logged
 
tzippy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Re: control the order of the nodes
Reply #2 - Feb 19th, 2009 at 2:34pm
Print Post  
Thanks.
Can you explain me please the order?
I mean, when I'm adding a child, is it on the left side of the diagram, right side or in the middle?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: control the order of the nodes
Reply #3 - Feb 19th, 2009 at 2:40pm
Print Post  
The last link that you create to connect a parent node to a child goes last in the parent's OutgoingLinks collection, and applying TreeLayout moves that last child to the right of the other children of that node. If you remove the link from OutgoingLinks and insert it again at a different position, applying the layout would result in moving the respective child node to the same position in the row of children.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
tzippy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Re: control the order of the nodes
Reply #4 - Feb 19th, 2009 at 2:50pm
Print Post  
And what about the other nodes?
I mean the brothers.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: control the order of the nodes
Reply #5 - Feb 19th, 2009 at 2:53pm
Print Post  
The links coming out from a parent are placed in the same order they are in OutgoingLinks, and as consequence, their Destination nodes (the children) are in that order too. To change the order of sibling nodes, find their parent and set the positions of the siblings' incoming links inside the parent's OutgoingLinks list.
  
Back to top
 
IP Logged
 
tzippy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Re: control the order of the nodes
Reply #6 - Feb 24th, 2009 at 1:28pm
Print Post  
I would like to know the order of the links.
In the diagram there is node with 8 OutGoingLinks.
Their indexes are: 2,3,0,1,6,7,4,5.
How can I order them like this: 0,1,2,3,4,5,6,7 simply?
Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: control the order of the nodes
Reply #7 - Feb 24th, 2009 at 1:35pm
Print Post  
node.OutgoingLinks.Clear(), and then call node.OutgoingLinks.Add() for each link in the order you need them. That probably would require you to keep a copy of the outgoing links collection so you don't lose the link references.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
tzippy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Re: control the order of the nodes
Reply #8 - Feb 24th, 2009 at 2:05pm
Print Post  
Thanks a lot.
Is there an option to order the nodes automatic from right to left or left to right, Or I need to write it myself?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: control the order of the nodes
Reply #9 - Feb 24th, 2009 at 2:37pm
Print Post  
There is the TreeLayout.Direction property, but left-to-right and right-to-left there define the order from parent to child node, and not the relative order of child nodes. So you might have to reverse the order of OutgoingLinks if what you need is reversing the order of children.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
tzippy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Re: control the order of the nodes
Reply #10 - Mar 23rd, 2009 at 3:18pm
Print Post  
Hi,
I arranged the outgoingLinks,
But they aren't shown according to that order.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: control the order of the nodes
Reply #11 - Mar 23rd, 2009 at 6:38pm
Print Post  
Hi,

Seems we broke this while implementing your 'assistant' nodes. We'll upload a fix tomorrow.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: control the order of the nodes
Reply #12 - Mar 24th, 2009 at 9:49am
Print Post  
Should work as expected with this version:
https://mindfusion.eu/_beta/wpfdiag_treeltfix.zip
  
Back to top
 
IP Logged
 
tzippy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Re: control the order of the nodes
Reply #13 - Mar 29th, 2009 at 1:08pm
Print Post  
Hello,
I checked the new dlls you sent me, but my problem was not fixed. I want explain again what is my problem: I have a DiagramNode that its OutGoingLinks property contains 4 links. I want that the links will be ordered in the same order they are in the OutGoingLinks list, but they aren't: The OutGoingLinks list contains the following nodes in this order: Node A, Node B, Node C and Node D, but in the diagram, after I added the links and did TreeLayout.Arrange operation the nodes are displayed in the following order from left to right: Node C, Node D, Node A, Node B. Why it is so? Why the nodes are not displayed in the same order their links are ordered in the OutGoingLinks  list??? 
Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: control the order of the nodes
Reply #14 - Mar 30th, 2009 at 6:52am
Print Post  
Hi,

Are you sure your project correctly references the new dll? Please check if after rebuild the dll in the bin/debug folder is the same as the one from the zip file.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint