Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem Layered Layout crossing arrows (Read 4855 times)
Exodus
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Mar 19th, 2008
Problem Layered Layout crossing arrows
Mar 19th, 2008 at 9:36am
Print Post  
Hello,

I'm testing the trial version of JDiagram for my company. I have the following problem and I hope we can solve this, because then I'm sure we will buy JDiagram.

I'm using the Layered Layout for some hierarchical layout. The problem is that not all arrow crossings were avoided, even if it is possible. It seems that the layout produces different outputs, when i'm changing the order of my "flowChart.createArrow(...)" code. In a special order the right output is produced, but I can't check the order before.

I uploaded 3 screenshots to imageshack, i hope you can take a look at it. The first is, how it should be. The second is one of the wrong outputs. And the third screenshot shows the same in the InSight demo, were it seems to work perfectly.






The following code is used to produce the arrows:


flowChart.createArrow(box4, box6);
flowChart.createArrow(box2, box7);
flowChart.createArrow(box3, box7);
flowChart.createArrow(box5, box6);
flowChart.createArrow(box3, box8 );
flowChart.createArrow(box6, box8 );
flowChart.createArrow(box1, box7);
flowChart.createArrow(box4, box9);
flowChart.createArrow(box6, box9);


Is there something I can do so that these arrow crossings were avoided and i I don't have to check the createArrow code order before?

Thanks for your time, I hope you can help me.

With kind regards
Christoph
« Last Edit: Mar 19th, 2008 at 11:27am by Exodus »  
Back to top
 
IP Logged
 
Exodus
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Mar 19th, 2008
Re: Problem Layered Layout crossing arrows
Reply #1 - Mar 19th, 2008 at 11:25am
Print Post  
One thing I found is that I have to create the arrows of box4, before I create the arrow of box5. Then the right diagram is created, but I can't check it before. There must be an other solution.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem Layered Layout crossing arrows
Reply #2 - Mar 19th, 2008 at 1:21pm
Print Post  
Hi,

This version should fix the problem:
https://mindfusion.eu/_temp/llayout_fix.zip

Stoyan
  
Back to top
 
IP Logged
 
Exodus
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Mar 19th, 2008
Re: Problem Layered Layout crossing arrows
Reply #3 - Mar 19th, 2008 at 2:49pm
Print Post  
Hi,

thank you for your responds.

I'm sorry to say, but it doesn't help completely. I still have the same problem that one arrow crosses another arrow. When I'm changing the order of this arrows:

flowChart.createArrow(box4, box6);
flowChart.createArrow(box5, box6);   

it works.

This is my [code]LayeredLayout layout = new LayeredLayout(0, 35, 35, 20, 20);

 

  layout.setAnchoring(2);

  layout.setOrientation(0);

 

  FlowChart flowChart = new FlowChart();

  flowChart.setArrowTextStyle(1);

  flowChart.setArrowCrossings(1);


  Box box1 = flowChart.createBox(20, 20, 20, 10);

  box1.setText("Person 1");

 
...


  Box box10 = flowChart.createBox(20, 20, 20, 10);

  box10.setText("jur. Person 2");



 

  flowChart.createArrow(box4, box6);

  flowChart.createArrow(box5, box6);
   

   

  flowChart.createArrow(box3, box7);

  flowChart.createArrow(box2, box10);

  flowChart.createArrow(box3, box8);

  flowChart.createArrow(box6, box9);

  flowChart.createArrow(box6, box8);

  flowChart.createArrow(box4, box9);

  flowChart.createArrow(box5, box6);   

  flowChart.createArrow(box4, box6);   

  flowChart.createArrow(box1, box10);

  flowChart.createArrow(box10, box7);

  flowChart.createArrow(box1, box7);



 

  layout.arrange(flowChart);

  flowChart.routeAllArrows();


  JFrame frame = new JFrame();

  frame.add(flowChart);

  frame.setSize(800, 850);

  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
[/code]

If you have an other idea I'm happy to hear it. Your program is great and I'm so close to the solution. I really want to use it.

With kind regards
Christoph
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem Layered Layout crossing arrows
Reply #4 - Mar 20th, 2008 at 9:15am
Print Post  
Hi,

Having fewer crossings is a side effect of other criteria the algorithm tries to follow. We'll have to modify it a lot so that it always finds the configuration with a minimal number of crossings, so we can't do that in the short run.

Stoyan
  
Back to top
 
IP Logged
 
Exodus
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Mar 19th, 2008
Re: Problem Layered Layout crossing arrows
Reply #5 - Mar 20th, 2008 at 12:33pm
Print Post  
Hi,

ok, thank you for the information. I will test it a little bit more, but I think we will use JDiagram. You will hear from us.

With kind regards
Christoph
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint