Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Layout and nodes position (Read 3602 times)
sledenev
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Dec 16th, 2009
Layout and nodes position
Oct 11th, 2010 at 2:06pm
Print Post  
Hi,

I need to include nodes to layout algorithm (e.g. tree layout) but I need to specify that position of this nodes must not be changed as the result of layout.

Whether there is a way to make it?

Thanks in advance.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layout and nodes position
Reply #1 - Oct 11th, 2010 at 2:45pm
Print Post  
Hi,

With TreeLayout you can do that only for the root node, by setting KeepRootPosition. If you need a fixed position for an internal tree node, you could run TreeLayout for a second time, specifying that node as TreeLayout.Root with KeepRootPosition enabled. If you need some node that's not part of the tree to stay in place, try setting its IgnoreLayout property.

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


I love YaBB 1G - SP1!

Posts: 25
Joined: Dec 16th, 2009
Re: Layout and nodes position
Reply #2 - Oct 11th, 2010 at 3:25pm
Print Post  
Stoyo wrote on Oct 11th, 2010 at 2:45pm:
Hi,

With TreeLayout you can do that only for the root node, by setting KeepRootPosition. If you need a fixed position for an internal tree node, you could run TreeLayout for a second time, specifying that node as TreeLayout.Root with KeepRootPosition enabled. If you need some node that's not part of the tree to stay in place, try setting its IgnoreLayout property.

I hope that helps,
Stoyan


I've already tried that. But this is not exactly what I need. I'll try to explain. Please look at the picture:
http://img220.imageshack.us/img220/7527/image0012vg.jpg

That's what I need:
Pic 1) It's a default treelayout result
Pic 2) Positions of the nodes after user interaction
Pic 3) After selecting node #2 and pressing some button, node #2 layed out as if all nodes where counted by algorithm but position of other nodes didn't changed.

Here is what I get ( see pic 4).

If I set IgnoreLayout=true for all nodes excepts nodes I need to layout then nodes stayed in their places, but in some cases they can overlap with each other which is not acceptable.



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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layout and nodes position
Reply #3 - Oct 11th, 2010 at 3:46pm
Print Post  
What does 4b show? The user drops node 4 at the layout position of node 3, and then you'd like node 3 to be placed at a different position when the layout function runs next time?
  
Back to top
 
IP Logged
 
sledenev
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Dec 16th, 2009
Re: Layout and nodes position
Reply #4 - Oct 12th, 2010 at 6:31am
Print Post  
Stoyo wrote on Oct 11th, 2010 at 3:46pm:
What does 4b show? The user drops node 4 at the layout position of node 3, and then you'd like node 3 to be placed at a different position when the layout function runs next time?


4b shows that user drags node #4 and then pressed some button which run layout function. I need that after layout function nodes positions become like in 4a. But instead of this node #4 overlap node #3 because node #1-#3 excluded from layout by setting IgnoreLayout=true.

My goal is to include all required nodes to the layout algorithm so they take part in algorithm computations, but only selected by user node changes their positions.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layout and nodes position
Reply #5 - Oct 12th, 2010 at 10:16am
Print Post  
So you need a method that returns selected nodes to their default TreeLayout positions? This won't work with IgnoreLayout, because then the algorithm would not process the same tree structure. Instead, you could arrange a copy of the diagram, and then copy back Bounds of all nodes that should return to their default positions.

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


I love YaBB 1G - SP1!

Posts: 25
Joined: Dec 16th, 2009
Re: Layout and nodes position
Reply #6 - Oct 12th, 2010 at 11:36am
Print Post  
Stoyo wrote on Oct 12th, 2010 at 10:16am:
So you need a method that returns selected nodes to their default TreeLayout positions? This won't work with IgnoreLayout, because then the algorithm would not process the same tree structure. Instead, you could arrange a copy of the diagram, and then copy back Bounds of all nodes that should return to their default positions.

I hope that helps,
Stoyan


That's what I afraid of Smiley I'll try that, thank you for your help!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint