Pat asked:
> Miguel,
>
> Would it be possible to support copying a MOL string off the system
> clipboard:
>
> // Get data from clipboard
> Transferable clipData =
> clipboard.getContents(clipboard);
> // Make sure not empty
> if (clipData != null) {
> // Check if it supports the desired flavor
> if (clipData.isDataFlavorSupported
> (DataFlavor.stringFlavor)) {
> // Get data
> String s = (String)(clipData.getTransferData(
> DataFlavor.stringFlavor));
> // Use data
> ...
> }
> }
>
Pat,
This is a very good question. Unfortunately, we cannot do this with the
unsigned/untrusted JmolApplet.
Accessing the local system clipboard was considered a potential security
violation. Therefore, an untrusted applet cannot access the local
clipboard when running in the secure applet sandbox.
A "poor man's substitute" would be for you to have a textarea in your HTML
page where you could paste your MOL file. You could then press a button to
load the contents of that textarea into the JmolApplet.
Since we are on the subject of security, there are two other restrictions
that are worth pointing out.
- An unsigned applet cannot read files from the local file system. This
means that we cannot let users load .pdb files from their local system.
- An unsigned applet cannot load files from a web server other than the
one it was loaded from. This means that the applet cannot load files
directly from the PDB.
I am hoping/planning to release a signed/trusted Jmol applet in the
future, which may be more appropriate for some applications.
*** 2 minutes later ***
I now realize that you were probably asking about the Jmol application
instead of the JmolApplet.
Yes! Good suggestion!
Miguel
-----
Open Source Molecular Visualization
www.jmol.org
[EMAIL PROTECTED]
-----
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Jmol-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-users