Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic An IllegalArgumentException when pribt previewing (Read 5916 times)
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
An IllegalArgumentException when pribt previewing
May 17th, 2007 at 10:27am
Print Post  
I've created a FlowChart, and then ran:

m_chart.printPreview();


What I got is this:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: input == null!
at javax.imageio.ImageIO.read(Unknown Source)
at com.mindfusion.jdiagram.PrintPreview.createImageIcon(Unknown Source)
at com.mindfusion.jdiagram.PrintPreview.InitializeComponent(Unknown Source)
at com.mindfusion.jdiagram.PrintPreview.<init>(Unknown Source)
at com.mindfusion.jdiagram.FlowChart.printPreview(Unknown Source)
at MainFrame.printPreview(MainFrame.java:132)

May be a resource is missing?
Thanks,
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: An IllegalArgumentException when pribt preview
Reply #1 - May 17th, 2007 at 10:49am
Print Post  
It might be the same problem as before - looking for resources relative the "this" object class, and not to the FlowChart one. We'll check this.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: An IllegalArgumentException when pribt preview
Reply #2 - May 17th, 2007 at 11:04am
Print Post  
Yes, it was the same problem -

_flowChart.getClass().getResourceAsStream(path)

instead of

FlowChart.class.getResourceAsStream(path)

Now this should work better -
http://www.mindfusion.org/_temp/JDiagram.jar

We have also made some changes to SpringLayout. Could you check if it will work better on your side. We used the following settings for testing and did not get any overlapping nodes in 30-40 tries:

SpringLayout spring = new SpringLayout();
spring.setIterations(100);
spring.setMinimizeCrossings(true);
spring.setNodeDistance(Diagram.BOX_WIDTH);
spring.arrange(fc);

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: An IllegalArgumentException when pribt preview
Reply #3 - May 17th, 2007 at 11:32am
Print Post  
Thanks for the new build.
It did fix the PrintPreview, but the layout is still wrong.
I used the same code you wrote here, but each time I run it I get intersections.
Here's example of 4 consecutive runs:
http://albums.tapuz.co.il/Albums/getImage.aspa=1248443&b=0&c=1248443200751716290...

Maybe it's the specific boxes connections I'm using?
Thanks,
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: An IllegalArgumentException when pribt preview
Reply #4 - May 17th, 2007 at 11:36am
Print Post  
Hi,

Try running more iterations of the layout. Each iteration step moves the nodes at a very short distance, e.g. a millimeter, so it will take more of them to disentangle larger graphs.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: An IllegalArgumentException when pribt preview
Reply #5 - May 17th, 2007 at 11:47am
Print Post  
I've raised the iterations nmber to 100000 (waiting 10 seconds) - but still. It does look a bit better...
Could it be because of the sophistication of the chart? Is there a way to tell it to use beziers or other types of lines to avoid this problem?
Thanks,
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: An IllegalArgumentException when pribt preview
Reply #6 - May 17th, 2007 at 11:50am
Print Post  
Ok, probably you should try the LayeredLayout - it is better for diagrams with a large number of links.
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: An IllegalArgumentException when pribt preview
Reply #7 - May 20th, 2007 at 11:09am
Print Post  
It does look better.
Thanks!
Yoav
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint