Dear users, I face a technical difficulty in using the « set pickcallBack ‘jmolscript’ » facility of jMol.
First of all, my application is: - a java code embedding an object jmolLigPanel of JmolPanel type - jMolPanel extends class JPanel and the associated constructor simply executes the line: viewer = jmolViewer.allocateViewer(this, new smarterJmolAdapter, null, null, null, null, null); - inside my java application, the following java instruction is called : jmolLigPanel.viewer.script(« set pickcallback ‘jmolscript: bondPickingAction.spt' »); - I have written a « jmol program » (in file bondPickingAction.spt), that has to be run when the user clicks on one bond in the jMolPanel interface. - This spt file is located in the main directory of my java application - to give an idea: getProperty(« varinfo ») gives: variable.defaultdirectory « /Users/henon/Documents/workspaceJBox/JBox » (where I have put the file bondPickingAction.spt). I currently use the Eclipse IDE to develop this java application. When I run my java application from the Eclipse environmenent, all works perfectly, and the corresponding Jmol actions are performed when I click on chemical bonds. However, this does not work any longer when I use the runnable jar built from Eclipse. I guess the problem is that the java command jmolLigPanel.viewer.script(« set pickcallback ‘jmolscript: bondPickingAction.spt' »); is passed to the jmol environement which does not know where to find the bondPickingAction.spt file in the jar archive. I tried different ways to tell the runnable archive where to find this spt file, but it does not work. Precisely, I put this file in the bin/, in the /lib, in the main directories of the jar archive. When I extract the jar archive to have a look, the file bondPickingAction.spt is present. Does anyone already met this kind of problem before with jmol ? How could I do to tell jmol where to find the spt script when using the « set pickcallback » instruction ? Or maybe this specific Jmol function could be declared in a userJmolFunction.spt file instead (rather than in the separate bondPickingAction.spt file) that the java application would read first ? Is it possible to call a jmol function rather than a file within the set pickcallback instruction ? Any idea or any other way to proceed will be appreciated ! Thanks in advance ! Eric ------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users