Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Difference in Layout webforms and Winforms (Read 2843 times)
ebibnet
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 15
Joined: Aug 25th, 2008
Difference in Layout webforms and Winforms
Aug 31st, 2008 at 10:13pm
Print Post  
Hi,
I studied the layout example flowlayout  included in FLOWCHART.NET

I adjusted your example with my data and the layout reacts accordingly what we need.

Then i copied exactly the same code in my project (Netdiagram) but he ignores some layout rules. I'm breaking my head now because both codes are the same only the environment is different. SO i wonder if they behave differently ?


snippet


   
           diagram.RoutingOptions.CrossingCost = 100;
           diagram.RoutingOptions.Anchoring = Anchoring.Ignore;


           

           FlowLayout flowLayout = new FlowLayout();
           flowLayout.AutoRoute = true;
           flowLayout.HorizontalGroupOffset = 30;
           flowLayout.VerticalGroupOffset = 18;
           flowLayout.NodeDistance = 8;
           flowLayout.Margins = new SizeF(2, 2);

           // define direction rules for the connector types
           FlowLayoutRules rules = flowLayout.LayoutRules;
           rules.PreferredRules = PreferredRules.ConnectorRules;


               rules.ConnectorRules.DownOriented = new string[]  {"O0" };
               rules.ConnectorRules.RightOriented = new string[] { "O1" };
               rules.ConnectorRules.LeftOriented = new string[] { "O2" };
               rules.ConnectorRules.UpOriented = new string[] { "O3" };
         


           // miscellaneous rules
           rules.NodeRules.GroupStartNodes = "START";
        rules.ConnectorRules.HorizontalBendOrientation = false;

           // arrange the flowchart and fit it into view
           flowLayout.Arrange(diagram);
           diagram.ResizeToFitItems(5);


He ignores the left /right / etc.. oriented statements, it has no effect whatever i do.

Someone know where the issues might be ?

Thanks
R.


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Difference in Layout webforms and Winforms
Reply #1 - Sep 1st, 2008 at 8:34am
Print Post  
Hi,

Are you running the layout code before or after postback? If it behaves differently after postback, it might mean that we've forgotten saving the items' LogicID values in the view state.

Stoyan
  
Back to top
 
IP Logged
 
ebibnet
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 15
Joined: Aug 25th, 2008
Re: Difference in Layout webforms and Winforms
Reply #2 - Sep 1st, 2008 at 5:56pm
Print Post  
Hello stoyo,
The code runs after postback.

Tks!
  
Back to top
 
IP Logged
 
ebibnet
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 15
Joined: Aug 25th, 2008
Re: Difference in Layout webforms and Winforms
Reply #3 - Sep 1st, 2008 at 8:13pm
Print Post  
Hello,
I think a could track the issue

Code
Select All
 DiagramLink link ;
		link = diagram.Factory.CreateDiagramLink(diagram.Nodes[0], diagram.Nodes[1]);
		link.LayoutTraits[FlowLayoutTraits.LogicID] = "o0";
		link.Text = "o0";


		link = diagram.Factory.CreateDiagramLink(diagram.Nodes[1], diagram.Nodes[2]);
		link.LayoutTraits[FlowLayoutTraits.LogicID] = "o0";
		link.Text = "o0";


		link = diagram.Factory.CreateDiagramLink(diagram.Nodes[2], diagram.Nodes[3]);
		link.LayoutTraits[FlowLayoutTraits.LogicID] = "o0";
		link.Text = "o0";


		link = diagram.Factory.CreateDiagramLink(diagram.Nodes[3], diagram.Nodes[4]);
		link.LayoutTraits[FlowLayoutTraits.LogicID] = "o0";
		link.Text = "o0";


		link = diagram.Factory.CreateDiagramLink(diagram.Nodes[4], diagram.Nodes[5]);
		link.LayoutTraits[FlowLayoutTraits.LogicID] = "oO";
		link.Text = "oO";


		link = diagram.Factory.CreateDiagramLink(diagram.Nodes[6], diagram.Nodes[5]);
		link.LayoutTraits[FlowLayoutTraits.LogicID] = "o0";
		link.Text = "o0";


		link = diagram.Factory.CreateDiagramLink(diagram.Nodes[1], diagram.Nodes[6]);
		link.LayoutTraits[FlowLayoutTraits.LogicID] = "K";
		link.Text = "K";


		link = diagram.Factory.CreateDiagramLink(diagram.Nodes[6], diagram.Nodes[1]);
		link.LayoutTraits[FlowLayoutTraits.LogicID] = "";
		link.Text = "";


rules.ConnectorRules.DownOriented = new string[] { "o0" };
			 rules.ConnectorRules.RightOriented = new string[] { "o1" };
			 rules.ConnectorRules.LeftOriented = new string[] { "O2" };
			 rules.ConnectorRules.UpOriented = new string[] { "O3" };
 




The fact that there are 1 (most of the time ok) or more logic id's  are not  one of the values o1,o2,O3 or 04  make sthat the drawing will screw up... (shapes overlapping each other etc...

In this example the last 2 id's are "" and "K" causes this effect. when i change the K in o1 then layout is fine. but when this is not the case ...
This means one has to be very rigid when assigning LogicId's ?

Tks,

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Difference in Layout webforms and Winforms
Reply #4 - Sep 2nd, 2008 at 7:08am
Print Post  
Hi,

From what I can understand from the code, it seems Flowlayout processes links by looping over the ID lists specified in ConnectorRules, and then for each ID in the list it loops over the links with the same LogicID. So if some ID is not in the list, links with that ID are ignored.

Regarding postback, it won't work when using applet mode. We haven't implemented Flowlayout in Java yet, and the values in LayoutTraits are lost during postbacks. We'll release a service version that implements LayoutTraits serialization, so at least it would allow using Flowlayout in applet mode on the server side.

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