Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic FlowLayout, Arrange of DiagramItemCollection (Read 3380 times)
kai-uwe.zoland
YaBB Newbies
*
Offline



Posts: 18
Joined: Sep 5th, 2008
FlowLayout, Arrange of DiagramItemCollection
Mar 15th, 2010 at 2:17pm
Print Post  
I use the FlowLayout.Arrange(Diagram, DiagramItemCollection) method to arrange parts in a diagram.
As input in the DiagramItemCollection I have just some nodes, that are connect with the MainConnectorId. The GroupEndNode and the GroupStartNode are part of the collection. For some groups it works fine and for other groups the GroupStartNode is not arranged on the same height as the rest of the group.

I tested it with a small controlflow. If I use the normal Layout.Arrange(Diagram) method, the layout looks fine. If I put this controlflow to a group and give all these nodes and links as a DiagramItemCollection to the arrange method, the result is different and the nodes are not placed on the same height.

Can you give some advice, please? I can send you also a small application, to show you the problem.

Thanks for your help.

Kai-Uwe
  
Back to top
WWWYIM  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowLayout, Arrange of DiagramItemCollection
Reply #1 - Mar 15th, 2010 at 7:06pm
Print Post  
Please send the sample to support@mindfusion.eu.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowLayout, Arrange of DiagramItemCollection
Reply #2 - Mar 23rd, 2010 at 9:39am
Print Post  
Set KeepGroupLayout = false before calling flowLayout.Arrange(diagram, _itemsToArrange) in the arrangeGroup method:

flowLayout.KeepGroupLayout = false;
flowLayout.Arrange(diagram, _itemsToArrange);

Otherwise Arrange does nothing at all if called for group's items while KeepGroupLayout is enabled. Once all groups are arranged, set KeepGroupLayout = true and call Arrange for the whole diagram.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
kai-uwe.zoland
YaBB Newbies
*
Offline



Posts: 18
Joined: Sep 5th, 2008
Re: FlowLayout, Arrange of DiagramItemCollection
Reply #3 - Mar 25th, 2010 at 11:19am
Print Post  
Hi,
the advice with KeepGroupLayout helped for the simple case. But now I build a more complex process and have some issues. I will send you a further version of the testapplication.

Problem 1:
I have a process, that is on three different lanes. The nodes on each lane are together in one group. First I call the arrange for each group and afterwards the arrange for the diagram with KeepGroupLayout = true.

After the arrange, the firstnode of the groups is not on the same height as the rest of the group. I have the impression, that the arrange of one group also has influence on the first nodes of the other groups. All nodes outside the group, that is arranged, have ignorelayout set to true. Can you please check this.

Problem 2:
I get an exception from the flowlayout arrange method: ‘Width and height can not have negative values’
To get this exception, try the Arrange Case 3 in the testapplication. I also got this exception, when I moved the nodes before any arrangement with the DiagramNode.Move method to some new positions.

Let me know, if you need any further information.
Thanks
Kai-Uwe
  
Back to top
WWWYIM  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowLayout, Arrange of DiagramItemCollection
Reply #4 - Mar 26th, 2010 at 2:21pm
Print Post  
Hi,

This version should fix the problem -
https://mindfusion.eu/_beta/wpfdiag231_flow.zip

Stoyan
  
Back to top
 
IP Logged
 
kai-uwe.zoland
YaBB Newbies
*
Offline



Posts: 18
Joined: Sep 5th, 2008
Re: FlowLayout, Arrange of DiagramItemCollection
Reply #5 - Mar 29th, 2010 at 1:30pm
Print Post  
Thank you, it works.

A question about the link routing between the groups. How can I ensure, that the first and last segment of these links always have horizontal orientation? I tried to set CascadeOrientation of these links to horizontal, but that did not help.

Thank you
  Kai-Uwe
  
Back to top
WWWYIM  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint