Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Enhance Container Node Layout (Read 6755 times)
fluber
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Nov 12th, 2007
Enhance Container Node Layout
Apr 22nd, 2008 at 1:45am
Print Post  
Dear Develop Team:

  I suggest that ...
 
  ContainerNode containerNode = diagram.Factory.CreateContainerNode(50,50,50,50);
  ShapeNode node1 = diagram.Factory.CreateShapeNode(25, 25, 25, 25);
  ShapeNode node2 = diagram.Factory.CreateShapeNode(25, 25, 25, 25);
DiagramLink link = diagram.Factory.CreateDiagramLink(node1, node2);

containerNode.add(node1);
containerNode.Add(node2);


TreeLayout layout = new TreeLayout();
layout.Arrange(containNode);

or

containNode.UpdateBounds(); //enhance this logic


Because the developer only know the width and the height of the shape node, they don't know the top and the left
of the shape node which in the container node.
Fluber
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Enhance Container Node Layout
Reply #1 - Apr 22nd, 2008 at 6:12am
Print Post  
Dear Fluber,

Are you suggesting us to add an Arrange(ContainerNode) overloaded method for arranging the items inside a container?

Stoyan
  
Back to top
 
IP Logged
 
fluber
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Nov 12th, 2007
Re: Enhance Container Node Layout
Reply #2 - Apr 22nd, 2008 at 7:04am
Print Post  
Yes. 
Initialize the container node content by programming. Like the above example, programmers only know how many child nodes in the container node and each node size.
After initializing the content, the child nodes in the container node will look like overlap.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Enhance Container Node Layout
Reply #3 - Apr 22nd, 2008 at 8:24am
Print Post  
Currently you can create a new DiagramItemCollection, add node1, node2 and link to it, and call layout.Arrange(DiagramItemCollection) followed by container.UpdateBounds(). It should be possible to do that automatically from an Arrange(ContainerNode) overload; we'll see if we can add it for the 5.1 release.

Stoyan
  
Back to top
 
IP Logged
 
fluber
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Nov 12th, 2007
Re: Enhance Container Node Layout
Reply #4 - Apr 22nd, 2008 at 8:51am
Print Post  
Thankx.
  
Back to top
 
IP Logged
 
fluber
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Nov 12th, 2007
Re: Enhance Container Node Layout
Reply #5 - Apr 22nd, 2008 at 9:10am
Print Post  
Dear Stoyo:

   I try use DiagramItemCollection and TreeLayout to arrange the child nodes. The result is not good enough. The child nodes and container node will display in the upper-Left corner.   I think container node left and top property should not be changed, the container node width and height should be changed by child nodes position.


Fluber
  
Back to top
 
IP Logged
 
fluber
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Nov 12th, 2007
Re: Enhance Container Node Layout
Reply #6 - Apr 22nd, 2008 at 9:17am
Print Post  
Dear Stoyo:

  I change keepRootPosition to true. It seems good enough.


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