-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 14 September 2004 16:52, Peter Murray-Rust wrote: > Greetings > I would like to do the following: > - create a Jmol swing component (ideally a JPanel but could be a JFrame)
It's a JPanel, see below. > - send it a CML Molecule Use e.g. viewer.openStringInline((String)cmlString), see below. > - display the molecule under Jmol control Not sure what you mean with that... but scripting is possible, and by default its rotable etc... > I have found Jmol.and CMLReader in jmol-9 source. The CMLReader needs a > DisplayControl, but I can't find where to construct this. We talked with > Miguel 2 months back and I seem to think it is fairly simple.. Please use the code from HEAD... See the Jmol/examples directory. This is a snippet from the Integration.java in that dir: public static void main(String[] argv) { JFrame frame = new JFrame("Hello"); frame.addWindowListener(new ApplicationCloser()); Container contentPane = frame.getContentPane(); JmolPanel jmolPanel = new JmolPanel(); contentPane.add(jmolPanel); frame.setSize(300, 300); frame.setVisible(true); JmolViewer viewer = jmolPanel.getViewer(); // viewer.openFile("../samples/caffeine.xyz"); // viewer.openFile("http://database.server/models/1pdb.pdb.gz"); viewer.openStringInline(strHOH); viewer.evalString(strScript); String strError = viewer.getOpenFileError(); if (strError != null) System.out.println(strError); } final static String strHOH = "3\n" + "water\n" + "O 0.0 0.0 0.0\n" + "H 0.76923955 -0.59357141 0.0\n" + "H -0.76923955 -0.59357141 0.0\n"; > If that works I would then ideally wish to pass it a set of CML molecules > to animate... Jmol v9 supported a <list> of <molecule>s... not sure about the CMLReader in HEAD, but that would be trivial to add... (the CMLReader is in src/org/jmol/adapter/smarter/CmlReader.java) Egon - -- [EMAIL PROTECTED] GPG: 1024D/D6336BA6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFBRy4/d9R8I9Yza6YRAvgEAJ0cvzX/cnw1yo4Yho1jzBAEJCJ7egCaAl0z NMKn5RU6qExB7M4sL1tLpY8= =GUtl -----END PGP SIGNATURE----- ------------------------------------------------------- This SF.Net email is sponsored by: thawte's Crypto Challenge Vl Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam Camcorder. More prizes in the weekly Lunch Hour Challenge. Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m _______________________________________________ Jmol-developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jmol-developers