Hi to all Jmol developers!

We are using Jmol for an embedded visualization component in our  
MZmine software (http://mzmine.sourceforge.net/).
I found that our visualization component works well with Jmol 11.6,  
but when I upgraded to Jmol 11.8.12, it stopped working.
I searched a bit and I found the problem happens when we call  
JmolViewer.loadInline() in the component constructor.

I made the following minimalistic example demonstrating the problem  
(works well with Jmol 11.6, but freezes with Jmol 11.8):

===============================================

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.JFrame;
import javax.swing.JPanel;
import org.jmol.adapter.smarter.SmarterJmolAdapter;
import org.jmol.api.JmolAdapter;
import org.jmol.api.JmolViewer;

public class Test extends JPanel {

        // Main application
        public static void main(String[] args) {
                JFrame newFrame = new JFrame();
                Test testComponent = new Test();
                newFrame.getContentPane().add(testComponent);
                newFrame.setSize(300, 300);
                newFrame.setVisible(true);
        }

        final static String strXyzHOH = "3\nwater\nO  0.0 0.0 0.0\n"
                        + "H  0.76923955 -0.59357141 0.0\n"
                        + "H -0.76923955 -0.59357141 0.0\n";

        JmolViewer viewer;
        JmolAdapter adapter;
        Dimension currentSize = new Dimension();
        Rectangle rectClip = new Rectangle();

        public Test() {
                adapter = new SmarterJmolAdapter();
                viewer = JmolViewer.allocateViewer(this, adapter);
                viewer.loadInline(strXyzHOH);
        }

        public void paint(Graphics g) {
                getSize(currentSize);
                g.getClipBounds(rectClip);
                viewer.renderScreenImage(g, currentSize, rectClip);
        }

}

===============================================


The problem seems to be that when we call the viewer.loadInline(), the  
thread hangs (deadlocks?) in the RepaintManager class waiting for the  
repaint to be finished, but the repaint is never finished because the  
component is just being constructed.

Is there anything wrong with my way of creating the JmolViewer?
Why it worked in 11.6 but not in 11.8?

Thanks a lot for any advice!

Best regards,

Tomas



===============================================
Tomas Pluskal
G0 Cell Unit, Okinawa Institute of Science and Technology
12-22 Suzaki, Uruma-shi, Okinawa 904-2234, JAPAN
TEL:  +81-98-921-3966




------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to