Dear Bob,

Thank you very much for your reply and these 2 possibilities !
I tried them but I’m not sure of the right syntax. I tried several
things, among which these ones seemed logical to me:

Option 1) 
String myCallBack = ‘’set pickcallback ‘jmolscript: script 
Jmol.jar|bondPickingAction.spt’ '';
jmolLigPanel.viewer.script(myCallBack);

Or directly:

jmolLigPanel.viewer.script(''  set pickcallback ‘jmolscript: script 
Jmol.jar|bondPickingAction.spt’   ");

But doesn’t work.

Option 2) (that I would prefer):

String jmolActions = ‘’    
\''allMyJmolInstructionsInOneStringBetweenQuotesHere;\''    ‘’; 

String setPickCallBack = '' set pickcallback ‘ jmolscript(‘’ +    jmolActions   
  +   ‘'  ) ‘   ‘’;

jmolLigPanel.viewer.script( setPickCallBack );

but it does not work either.
I guess it is only a syntax problem, (quoting ?)
Where am I wrong please ?


I tried a third option: adding the bondPickingAction.spt resource file
in Jmol.jar (—> jar uf Jmol.jar bondPickingAction.spt ),
but does not work either.

Thank you in advance for your help Bob !
Eric










> Le 25 mai 2016 à 21:29, Robert Hanson <hans...@stolaf.edu> a écrit :
> 
> Ah, OK. you mean you want that SPT file to be a Jar resource. Very 
> interesting! I have not tried that.The default location for that file will be 
> in the directory in which Jmol.jar was started. It would not normally access 
> anything in its own Jar file. 
> 
> However, there are two possibilities here. 
> 
> Option 1) Let jmol open up the  jar file (it is just a zip file) and get the 
> spt from there. The  pipe symbol is used to indicate you want a file from a 
> ZIP file:
> 
> $ background image "Jmol.jar|org/openscience/jmol/app/images/atomProps.gif"
> 
> 
> Option 2) Read the contents of the resource into a string using your 
> application and getClass().getResource().getContent()  and then pass that 
> string to Jmol using jmol.script() directly. You can do this straight from 
> your callback notification.
> 
> Bob
> 
> 
> ​
> ------------------------------------------------------------------------------
> 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


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

Reply via email to