From: Miguel <mi...@jm...> - 2004-11-22 21:59:42
|
Pat asked: > Miguel, > > Would it be possible to support copying a MOL string off the system > clipboard: > > // Get data from clipboard > Transferable clipData =3D > clipboard.getContents(clipboard); > // Make sure not empty > if (clipData =21=3D null) =7B > // Check if it supports the desired flavor > if (clipData.isDataFlavorSupported > (DataFlavor.stringFlavor)) =7B > // Get data > String s =3D (String)(clipData.getTransferData( > DataFlavor.stringFlavor)); > // Use data > ... > =7D > =7D > 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 =22poor man's substitute=22 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 t= o 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=21 Good suggestion=21 Miguel ----- Open Source Molecular Visualization www.jmol.org miguel=40jmol.org ----- |