Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Layout management question (Read 1120 times)
robo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
Joined: Apr 24th, 2009
Layout management question
Apr 24th, 2009 at 2:16am
Print Post  
Hi,

I've just started evaluating NetDiagram. So far I've only briefly reviewed the documentation and the class reference, but I would like to ask a question about layout management.

I want to create a diagram that contains nested ContainerNodes. Some ContainerNodes may contain one or more additional nested ContainerNodes, and some may contain ordinary nodes.

I would like to be able to control the layout management of each ContainerNode separately. For example, I may want some container nodes to lay out their contents in a horizontal flow layout, and other nodes in a vertical flow layout. Others I may want to use something other than the flow layout manager.

Is it possible to lay out individual ContainerNodes differently? I noticed that there is a LayoutTraits property in the DiagramItem class. Is that part of the mechanism for supporting this kind of layout management? How might this be accomplished?

Thanks!
Rob
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layout management question
Reply #1 - Apr 24th, 2009 at 8:00am
Print Post  
Hi Rob,

You could use the Arrange(DiagramItemCollection) method to arrange just the items inside a container:

Code
Select All
DiagramItemCollection childItems = new DiagramItemCollection();
foreach (DiagramNode childNode in container.SubordinateGroup.AttachedNodes)
{
	childItems.Add(childNode);
	foreach (DiagramLink link in childNode.OutgoingLinks)
		childItems.Add(link);
}
layout.Arrange(diagram, childItems);
 



It might be a good idea to call ContainerNode.UpdateBounds after Arrange.

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