Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Unconnected nodes in tree (Read 1422 times)
slowjoe
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Jul 28th, 2010
Unconnected nodes in tree
Oct 1st, 2010 at 9:23pm
Print Post  
Hi,

I have a tree layout and add a bunch of nodes that I read from a file then connect them.  I would also like to add "unconnected" nodes and have them automatically line up on the bottom or side of the view.  Is there a way to do this?

Thank you,
Joe
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Unconnected nodes in tree
Reply #1 - Oct 2nd, 2010 at 6:26am
Print Post  
Hi Joe,

Try setting TreeLayout.MultipleGraphsPlacement = MinimalArea. If you need more control over the node positions, you could do something like this:

Code
Select All
// add and arrange tree nodes
// ...
treeLayout.Arrange(diagram);

RectangleF r = diagram.GetContentBounds(false, true);
r.Y = r.Bottom + yoffset;

// add the rest of the nodes
// ...
foreach (DiagramNode node in unconnectedNodes)
{
	r.Width = node.Bounds.Width;
	r.Height = node.Bounds.Height;
	node.Bounds = r;
	r.X = node.Bounds.Right + xoffset;
} 



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


I love YaBB 1G - SP1!

Posts: 10
Joined: Jul 28th, 2010
Re: Unconnected nodes in tree
Reply #2 - Oct 4th, 2010 at 4:05pm
Print Post  
Hi Stoyan,

Thanks for the tip.  The second way (coding) seems to work a little better as I have more control over things.

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