At 19:45 14/09/2004 +0200, Egon Willighagen wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks

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 meant that the menus would appear...

> 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...

I am struggling to get this. I get the message that pserver is not supported. Is this a client or SF problem?


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...

Yes - and it works beautifully. I shall show this shortly (I hope)

 not sure about the CMLReader in
HEAD, but that would be trivial to add...

As long as I know how to package it after reading...

(the CMLReader is in
src/org/jmol/adapter/smarter/CmlReader.java)

P.


Peter Murray-Rust Unilever Centre for Molecular Informatics Chemistry Department, Cambridge University Lensfield Road, CAMBRIDGE, CB2 1EW, UK Tel: +44-1223-763069



-------------------------------------------------------
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

Reply via email to