Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Applying Lyouts to Partial Diagram (Read 6897 times)
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Applying Lyouts to Partial Diagram
Mar 26th, 2008 at 6:04pm
Print Post  
Hi Stoyan

I see that one of the overlaods on the Arrange method on the tree layout type allows for a collection of items to be supplied. I'm trying to apply a tree layouts to groupings of about 10 nodes of a larger diagam in order to preserve certain presentation requirements - applying a tree to the whole diagram works as expected, but when supplying an ItemCollection it seems to have no effect. Is what I'm attempting possible with the layout functionality?


Many thanks


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Applying Lyouts to Partial Diagram
Reply #1 - Mar 27th, 2008 at 7:56am
Print Post  
Hi Paul,

You must also add the links to that collection - the method won't work if you call it with a collection that contains only nodes.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Applying Lyouts to Partial Diagram
Reply #2 - Mar 27th, 2008 at 11:07am
Print Post  
Hi Stoyan

Thanks for thr tip - i tried this but there still seems to be no effect.

In my control contsructor i have ther following code to set up the tree layout:

       With mTreeLayout
           .Type = Layout.TreeLayoutType.Cascading
           .Direction = Layout.TreeLayoutDirection.LeftToRight
           .LinkStyle = Layout.TreeLayoutLinkType.Cascading2
           .LevelDistance = 150

           .KeepRootPosition = True
       End With


The layout is applied after the nodes have been added to the diagram, with the following code:
Dim oItems As New MindFusion.Diagramming.Wpf.DiagramItemCollection

     
           Dim oLayoutRoot As ShapeNode = DirectCast(oSfeFlow.FindNode(pRootTag), ShapeNode)
           oItems.Add(oLayoutRoot)

           For Each oNode As DiagramNode In oLayoutRoot.MasterGroup.AttachedNodes
               oItems.Add(oNode)
               oItems.Add(oNode.IncomingLinks(0))
           Next
            mTreeLayout.Root = oLayoutRoot
           mTreeLayout.Arrange(oSfeFlow, oItems)
      
During node creation i set the item bounds to 0,0,200,200 as the location should be getting applied when the layout comes into effect. 

Going on the above, is there something I'm doing wrong?


Many thanks


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Applying Lyouts to Partial Diagram
Reply #3 - Mar 27th, 2008 at 1:08pm
Print Post  
Hi Paul,

If the links go from the child nodes in the tree to their parents, enable the TreeLayout.ReversedLinks property. Additionally, the KeepGroupLayout option should be disabled in this case, since you are trying to arrange a group. KeepGroupLayout should be disabled by default, but it could be set through the TreeLayout constructor, and I can't see the constructor code in your post.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Applying Lyouts to Partial Diagram
Reply #4 - Mar 27th, 2008 at 2:31pm
Print Post  
Hi Stoyan

The links radiate from the proposed layout root (shapenode) so iI don't need the reversed links  option.  my constructor for th elayout obect is as follows:

Private mTreeLayout As New Mindfusion.Diagramming.Wpf.TreeLayout

though i will try setting the keepGroupLayout to false manually, just to be sure.
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Applying Lyouts to Partial Diagram
Reply #5 - Mar 27th, 2008 at 6:56pm
Print Post  
Hi Paul,

Could you email us an image of what your graph looks like, or a saved diagram file?

Thanks,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint