Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Query regarding layouts. (Read 1079 times)
anurodhora
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 103
Joined: Jan 19th, 2009
Query regarding layouts.
Mar 18th, 2009 at 2:15pm
Print Post  
Hi,

I am using GridLayout and Hierarchy layout for arranging the decision shaped nodes in the diagram. The code that I have used for the purpose is as follows :

GridLayout :

private void btnCompact_Click(object sender, RoutedEventArgs e)
{
GridLayout gridLayout = new GridLayout();
gridLayout.GridSize = 75;
gridLayout.Arrange(diagram);
}

TreeLayout :

private void btnHierarchy_Click(object sender, RoutedEventArgs e)
{
TreeLayout treeLayout = new TreeLayout();
treeLayout.Type = TreeLayoutType.Centered;
treeLayout.LevelDistance = 10;
treeLayout.KeepRootPosition = true;
treeLayout.Arrange(diagram);
}

The issues faced by me is as follows :

1. I have set of main nodes in the diagram and a set of attached nodes with each main node there is a single attached node associated with it. Now the issue is when i try to arrange the nodes either in TreeLayout or GridLayout the attached nodes get disassociated with the main node and the complete arrangements gets destroyed. I dont want the attached node to get disassociated with the main node i.e the association between a main node and attached node pair in the diagram should not get distorted when I try to arrange them in either of the layouts.

The code used for the association of main node called as "mainNode" and attached node called as "labelNode" in the code is as follows :

labelNode.AttachTo(mainNode, AttachToNode.BottomCenter);

Any suggestion how can I accomplish the desired task.

Thanks and Regards,
Anurodh.


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Query regarding layouts.
Reply #1 - Mar 18th, 2009 at 3:01pm
Print Post  
Hi,

You have two options. One is to run the layout functions with the KeepGroupLeyout property enabled, the other is to set IgnoreLayout = true for the label nodes. The difference is that the former will includes the label nodes in the calculations of node sizes, the latter will ignore them.

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