From: Vincent Le G. <vin...@un...> - 2009-10-05 08:29:10
|
> The time here is 1400 so I am going to take a nap. When you post your code > pls include the echo report that includes the version and OS info. I will > have a look at this again tomorrow if no one else has provided the answer. OS: linux ubuntu last version Jmol version: 11.9.6 Here is the code, it's currently really basic & simple. public class JmolPanel extends JPanel { private JmolViewer viewer; private JmolPopup popup; private JmolAdapter adapter; public JmolEvolvedPanel() { adapter = new SmarterJmolAdapter(); viewer = new Viewer(this, adapter); popup = JmolPopup.newJmolPopup(viewer, true, null, true); } public void setStructure(Structure struct) { String pdbstr = struct.toPDB(); viewer.openStringInline(pdbstr); String strError = viewer.getErrorMessage(); if (strError != null) { System.out.println("Error in jmol: "+strError); } popup.updateComputedMenus(); } public void executeCmd(String rasmolScript) { viewer.evalString(rasmolScript); } final Dimension currentSize = new Dimension(); final Rectangle rectClip = new Rectangle(); @Override public void paint(Graphics g) { getSize(currentSize); g.getClipBounds(rectClip); viewer.renderScreenImage(g, currentSize, rectClip); } } |