[Jmol-users] Should translucency be additive?

2011-08-07 Thread Dean Johnston
Jmol'ers,

  I just noticed an interesting effect in Jmol.  I have a model with several
planes having different levels of translucency.  But Jmol only seems to use
the translucency of the frontmost plane when looking at something that falls
behind two translucent planes.  I suspect this is in the name of efficiency,
but didn't know if anyone else had noticed this.

Dean
--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] PQR file with Jmol

2011-08-07 Thread Robert Hanson
Jmol has a PQR reader -- points, charge, and radius. Jmol will assign the
partial charge and VDW radius from the file data. (Although radii < 0.9 are
simply assigned 1.0)

Let us know if you have problems with it - just send me the file that causes
the problems.

Bob


On Sun, Aug 7, 2011 at 10:03 AM, Martin Hediger  wrote:

> Dear List
> I am trying to visualize a PQR file in Jmol. The PQR file has an
> additional column of data behind the coordinates in the standard PDB file.
> Is it possible out-of-the-box?
>
> Thanks for any hints.
> Martin
>
>
> --
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


[Jmol-users] PQR file with Jmol

2011-08-07 Thread Martin Hediger
Dear List
I am trying to visualize a PQR file in Jmol. The PQR file has an 
additional column of data behind the coordinates in the standard PDB file.
Is it possible out-of-the-box?

Thanks for any hints.
Martin

--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] save a Jmol session in a file to be restored afterwards

2011-08-07 Thread Robert Hanson
(this can be used anywhere a script is used in any of the Jmol.js functions)

On Sun, Aug 7, 2011 at 9:44 AM, Robert Hanson  wrote:

> Angel, is that JavaScript function option mentioned at the Jmol Wiki?
>
> jmolButton([funcName,param1, param2, param3...], text)
>
> runs a predefined JavaScript function  funcName with parameters
> param1, param2, param3 as:
>
> function funcName(btn, obj, target) {
>   // entire array object provided as 2nd parameter;
>   // JavaScript to execute here.
>   var param1 = obj[1]
>   var param2 = obj[2]
>   var param3 = obj[3]
>   
> }
>
> Bob
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] save a Jmol session in a file to be restored afterwards

2011-08-07 Thread Robert Hanson
Angel, is that JavaScript function option mentioned at the Jmol Wiki?

jmolButton([funcName,param1, param2, param3...], text)

runs a predefined JavaScript function  funcName with parameters
param1, param2, param3 as:

function funcName(btn, obj, target) {
  // entire array object provided as 2nd parameter;
  // JavaScript to execute here.
  var param1 = obj[1]
  var param2 = obj[2]
  var param3 = obj[3]
  
}

Bob
--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] save a Jmol session in a file to be restored afterwards

2011-08-07 Thread Daniel Carbajo
This does not work either Paul...

2011/8/7 Paul Pillot 

> Try this instead echo "";
>
> Le 7 août 2011 à 15:08, Daniel Carbajo a écrit :
>
> echo "";
>
>
>
>
> --
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] save a Jmol session in a file to be restored afterwards

2011-08-07 Thread Paul Pillot
Try this instead echo "";

Le 7 août 2011 à 15:08, Daniel Carbajo a écrit :

> echo "";

--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] jmolApplet tempo problem

2011-08-07 Thread Daniel Carbajo
OK at the end I've managed to solve it including the commands inside var
jmolcmds. Thanks again Bob!

2011/8/7 Daniel Carbajo 

> Thanks Bob, sorry for not answering before I was travelling... I think I
> miss something... what you say is exactly what I do above right?
>
> I run the applet with:
> $JMOL = "
> jmolInitialize(\"Jmol-12new\", true);
> jmolSetAppletColor(\"white\");
>  var jmolcmds = [
> \"load $jmolfile\",
> \"set frank off; select all; hbonds off; spin off; wireframe off; spacefill
> off; trace off; set ambient 40; set specpower 40; slab off; ribbons off;
> cartoons off; label off; monitor off\",
>  \"set isosurfacePropertySmoothing TRUE\",
> ...
> \"script Jmol-12new/myJMOLfunctions.spt\",
>  \"javascript appletLoaded()\"
> ];
> jmolApplet([450,450], jmolcmds.join(\"; \"));
> ";
>
> foreach ($AllResidues as $residue){
> if (array_key_exists($residue, $SelectedResiduesHash)){
>  echo " type=\"text/javascript\">appletLoaded(\"$residue\")";
> }
>
>
>
> And the function appletLoaded looks like:
>
> 
> function appletLoaded(res){
> if (res){
> var state=jmolGetPropertyAsString(\"stateInfo\");
>  alert(res + ' --- ' + state);
> }
> }
> 
>
>
> In the example I am trying I have 3 residues in $SelectedResiduesHash, so I
> get 3 alerts with the appletLoaded function, but I only get the stateinfo
> correctly for the last 2 residues, for the first one its value is 'null',
> which I think indicates that the applet has not finished loading, right? In
> fact I get the same result when I just remove the \"javascript
> appletLoaded()\" line, so there is obviously something I am doing wrong...
> any idea? Thanks a lot Bob!
> Daniel
>
>
>
> 2011/8/5 Robert Hanson 
>
>> The basic scheme is what you have there:
>>
>> JmolApplet(.,"... javascript appletLoaded()")
>>
>> then your appletLoaded function will be called, and you can add JmolScript
>> or JmolGetPropertyAsArray commands then to that. You must not try to contact
>> Jmol until it is ready. Also, in the latest version of Jmol, we have
>>
>> set readyCallback 
>>
>> which specifically calls you back when the applet is ready. Note, however,
>> that this event is sent BEFORE  the script is executed, not after.
>>
>> Bob
>>
>>
>>
>>  On Fri, Aug 5, 2011 at 11:26 AM, Daniel Carbajo <
>> daniel.carb...@gmail.com> wrote:
>>
>>>  Dear everyone,
>>> the problem I have is the following:
>>> I load a structure in an applet and I check in a hash some residues that
>>> I put in wireframe by default. Since this second command is sent by
>>> jmolScriptWait just after jmolApplet, it does not succeed as the applet
>>> takes time to be built. There is a partial solution here
>>> http://jmol.sourceforge.net/jslibrary/index.en.html#jmolApplet but I
>>> cannot make it work, it reads:
>>>
>>> *Note*:
>>> It takes some time to build the applet, so if you put some immediate
>>> action like jmolScript() or jmolLoadInline() right after the
>>> jmolApplet() line, it will probably fail because it will be called
>>> before the applet has finished loading. There are two alternatives that will
>>> work:
>>>
>>>- Put the commands inside the call to jmolApplet() (its 2nd
>>>argument, script).
>>>- Have the browser wait until the applet reports to be finished. To
>>>do so, put this at the end of the script sent with applet creation: 
>>> javascript
>>>appletLoaded(); and define a JavaScript function calledappletLoaded() (or
>>>any other name you like) that will trigger any further commands.
>>>
>>>
>>>
>>>
>>> I try the second solution since I have to check the residues in the hash,
>>> so I do the following (instead of the putting the residue in wireframe I
>>> alert the state, so I can see if the applet has already loaded):
>>>
>>> 
>>> function JmolCargado(res){
>>> if (res){
>>> var state=jmolGetPropertyAsString(\"stateInfo\");
>>>  alert(res + ' --- ' + state);
>>> }
>>> }
>>> 
>>>
>>>
>>>
>>>
>>> $JMOL = "
>>> jmolInitialize(\"Jmol-12new\", true);
>>>  jmolSetAppletColor(\"white\");
>>> var jmolcmds = [
>>> \"load $jmolfile\",
>>>  \"set frank off; select all; hbonds off; spin off; wireframe off;
>>> spacefill off; trace off; set ambient 40; set specpower 40; slab off;
>>> ribbons off; cartoons off; label off; monitor off\",
>>>  \"set isosurfacePropertySmoothing TRUE\",
>>> \"set showAxes true\",
>>>  \"frame all\",
>>> \"display all\",
>>> \"select 1.1; cartoon; set propertyColorScheme 'bwr'; color atoms
>>> property temperature ABSOLUTE $range\",
>>>  \"set perspectiveModel 10\",
>>> \"set zoomLarge off\",
>>>  \"move 0 0 0 50 0 0 0 0 2\",
>>> \"script Jmol-12new/myJMOLfunctions.spt\",
>>>  \"javascript appletLoaded()\"
>>> ];
>>> jmolApplet([450,450], jmolcmds.join(\"; \"));
>>> ";
>>>
>>>
>>> foreach ($AllResidues as $residue){
>>> if (array_key_exists($residue, $SelectedResiduesHash)){
>>>  echo ">> type=\"text/javascript\">JmolCargado(\"$residue\")";
>>> }
>>>
>>>
>>> It works just partially... I have 3 residues in $SelectedResiduesHash so

Re: [Jmol-users] jmolApplet tempo problem

2011-08-07 Thread Robert Hanson
This would be a lot easier if you can point me to your test page...

On Sun, Aug 7, 2011 at 5:11 AM, Daniel Carbajo wrote:

> Thanks Bob, sorry for not answering before I was travelling... I think I
> miss something... what you say is exactly what I do above right?
>
> I run the applet with:
> $JMOL = "
> jmolInitialize(\"Jmol-12new\", true);
> jmolSetAppletColor(\"white\");
>  var jmolcmds = [
> \"load $jmolfile\",
> \"set frank off; select all; hbonds off; spin off; wireframe off; spacefill
> off; trace off; set ambient 40; set specpower 40; slab off; ribbons off;
> cartoons off; label off; monitor off\",
>  \"set isosurfacePropertySmoothing TRUE\",
> ...
> \"script Jmol-12new/myJMOLfunctions.spt\",
>  \"javascript appletLoaded()\"
> ];
> jmolApplet([450,450], jmolcmds.join(\"; \"));
> ";
>
> foreach ($AllResidues as $residue){
> if (array_key_exists($residue, $SelectedResiduesHash)){
>  echo " type=\"text/javascript\">appletLoaded(\"$residue\")";
> }
>
>
>
> And the function appletLoaded looks like:
>
> 
> function appletLoaded(res){
> if (res){
> var state=jmolGetPropertyAsString(\"stateInfo\");
>  alert(res + ' --- ' + state);
> }
> }
> 
>
>
> In the example I am trying I have 3 residues in $SelectedResiduesHash, so I
> get 3 alerts with the appletLoaded function, but I only get the stateinfo
> correctly for the last 2 residues, for the first one its value is 'null',
> which I think indicates that the applet has not finished loading, right? In
> fact I get the same result when I just remove the \"javascript
> appletLoaded()\" line, so there is obviously something I am doing wrong...
> any idea? Thanks a lot Bob!
> Daniel
>
>
>
> 2011/8/5 Robert Hanson 
>
>> The basic scheme is what you have there:
>>
>> JmolApplet(.,"... javascript appletLoaded()")
>>
>> then your appletLoaded function will be called, and you can add JmolScript
>> or JmolGetPropertyAsArray commands then to that. You must not try to contact
>> Jmol until it is ready. Also, in the latest version of Jmol, we have
>>
>> set readyCallback 
>>
>> which specifically calls you back when the applet is ready. Note, however,
>> that this event is sent BEFORE  the script is executed, not after.
>>
>> Bob
>>
>>
>>
>>  On Fri, Aug 5, 2011 at 11:26 AM, Daniel Carbajo <
>> daniel.carb...@gmail.com> wrote:
>>
>>>  Dear everyone,
>>> the problem I have is the following:
>>> I load a structure in an applet and I check in a hash some residues that
>>> I put in wireframe by default. Since this second command is sent by
>>> jmolScriptWait just after jmolApplet, it does not succeed as the applet
>>> takes time to be built. There is a partial solution here
>>> http://jmol.sourceforge.net/jslibrary/index.en.html#jmolApplet but I
>>> cannot make it work, it reads:
>>>
>>> *Note*:
>>> It takes some time to build the applet, so if you put some immediate
>>> action like jmolScript() or jmolLoadInline() right after the
>>> jmolApplet() line, it will probably fail because it will be called
>>> before the applet has finished loading. There are two alternatives that will
>>> work:
>>>
>>>- Put the commands inside the call to jmolApplet() (its 2nd
>>>argument, script).
>>>- Have the browser wait until the applet reports to be finished. To
>>>do so, put this at the end of the script sent with applet creation: 
>>> javascript
>>>appletLoaded(); and define a JavaScript function calledappletLoaded() (or
>>>any other name you like) that will trigger any further commands.
>>>
>>>
>>>
>>>
>>> I try the second solution since I have to check the residues in the hash,
>>> so I do the following (instead of the putting the residue in wireframe I
>>> alert the state, so I can see if the applet has already loaded):
>>>
>>> 
>>> function JmolCargado(res){
>>> if (res){
>>> var state=jmolGetPropertyAsString(\"stateInfo\");
>>>  alert(res + ' --- ' + state);
>>> }
>>> }
>>> 
>>>
>>>
>>>
>>>
>>> $JMOL = "
>>> jmolInitialize(\"Jmol-12new\", true);
>>>  jmolSetAppletColor(\"white\");
>>> var jmolcmds = [
>>> \"load $jmolfile\",
>>>  \"set frank off; select all; hbonds off; spin off; wireframe off;
>>> spacefill off; trace off; set ambient 40; set specpower 40; slab off;
>>> ribbons off; cartoons off; label off; monitor off\",
>>>  \"set isosurfacePropertySmoothing TRUE\",
>>> \"set showAxes true\",
>>>  \"frame all\",
>>> \"display all\",
>>> \"select 1.1; cartoon; set propertyColorScheme 'bwr'; color atoms
>>> property temperature ABSOLUTE $range\",
>>>  \"set perspectiveModel 10\",
>>> \"set zoomLarge off\",
>>>  \"move 0 0 0 50 0 0 0 0 2\",
>>> \"script Jmol-12new/myJMOLfunctions.spt\",
>>>  \"javascript appletLoaded()\"
>>> ];
>>> jmolApplet([450,450], jmolcmds.join(\"; \"));
>>> ";
>>>
>>>
>>> foreach ($AllResidues as $residue){
>>> if (array_key_exists($residue, $SelectedResiduesHash)){
>>>  echo ">> type=\"text/javascript\">JmolCargado(\"$residue\")";
>>> }
>>>
>>>
>>> It works just partially... I have 3 residues in $SelectedResiduesHash so
>>> 

Re: [Jmol-users] save a Jmol session in a file to be restored afterwards

2011-08-07 Thread Daniel Carbajo
I have tried the following:
$colorcommand="select 1.1; color green;";
$JMOL .= "jmolButton(\"reset\", \"Original orientation\");
jmolButton(\"move 360 0 0 0 0 0 0 0 20\", \"Rotate X axis\");
jmolButton(\"move 0 360 0 0 0 0 0 0 20\", \"Rotate Y axis\");
jmolButton(\"write image.png\", \"Create image\");
jmolButton(\"$colorcommand\", \"RESTORE\");
";

And this works, which means I can directly call a php variable containing
Jmol commands in a jmolButton, but I cannot do the same with $ESTADO, so
there is probably some character inside $ESTADO that I should escape or
something... I really have no idea; so let's see if there is someone that
can solve this question:
How can I restore a Jmol state using a php variable containing the
output of jmolGetPropertyAsString("stateInfo")
I really really need help on this...




2011/8/7 Paul Pillot 

> Daniel,
> I'm not a good programmer enough to know what's wrong with your code just
> with those informations (it looks OK to me).
> When I want to debug my code with php I do the following :
> - run the php page
> - right click on the page and view source
> - try to locate in the HTML source where php inserts the computed content
> and see what's wrong there.
> I don't know from what you say if the php executes correctly, or if the
> HTML is wrong or if there is a problem with the way jmol scripts are sent to
> jmol ?
> Paul
>
> Le 7 août 2011 à 13:14, Daniel Carbajo a écrit :
>
> Thanks for the fast response Paul, I use floating boxes and a php function
> called centerbox to echo the contents of $JMOL, so it actually looks like
> this:
> $title1="Jmol view";
> $JMOL = "
> jmolInitialize(\"Jmol-12new\", true);
> jmolSetAppletColor(\"white\");
>  var jmolcmds = [
> \"load $jmolfile\",
> \"set frank off; select all; hbonds off; spin off; wireframe off; spacefill
> off; trace off; set ambient 40; set specpower 40; slab off; ribbons off;
> cartoons off; label off; monitor off\",
>  \"set isosurfacePropertySmoothing TRUE\",
> ...
>  \"script Jmol-12new/myJMOLfunctions.spt\",
>  \"javascript appletLoaded()\"
>  ];
> jmolApplet([450,450], jmolcmds.join(\"; \"));
> ";
>
> $JMOL .= "jmolButton(\"reset\", \"Original orientation\");
>  jmolButton(\"move 360 0 0 0 0 0 0 0 20\", \"Rotate X axis\");
> jmolButton(\"move 0 360 0 0 0 0 0 0 20\", \"Rotate Y axis\");
>  jmolButton(\"write image.png\", \"Create image\");
> ";
> centerbox($title1, $JMOL "#99");
>
> ...where centerbox is:
> function centerbox( $title, $contenuto, $color ) {
> echo "\n".
>  " solid;\"> $title ".
>  " \n".
>  $contenuto.
>  "";
> }
>
>
> In any case, I want a "Restore" button just beneath the other buttons, or,
> even better, to run $ESTADO directly with JmolScript and no clicking... I
> have tried several ways, including the one you suggest, but it does
> nothing... any clue? So how do I use $ESTADO (which is correct in terms that
> it includes all the information as I have echoed it) to restore the state?
> Thanks!
>
>
> 2011/8/7 Paul Pillot 
>
>> There's a problem with your php.
>> A php file can be a standard html file with php code parts included
>> between  tags.
>> If you set your php in a variable a $JMOL, then you don't have to use the
>>  syntax so the first option is the good one.
>> But I think there is something wrong in the statement of your first line
>> with the quotes you use, either simple or double ones. You should use
>> $JMOL .= 'jmolButton(''*'*.$ESTADO.'", "RESTORE");';
>> Try to debug that in php (echo $JMOL) and look at what it looks like in
>> the resulting HTML code. If your HTML is correct then the problem might be
>> with the script you pass to Jmol.
>> Paul
>>
>> Le 7 août 2011 à 12:41, Daniel Carbajo a écrit :
>>
>> OK I am completely lost with this actually... I am sorry for being quite
>> dumb but I just don't get it.
>> I already have the output of jmolGetPropertyAsString("stateInfo") in a PHP
>> variable called $ESTADO in my Second PHP Page (where I have to restore the
>> state), so how do I actually restore the state using that variable? I have
>> tried the following with 0 success:
>> $JMOL .= 'jmolButton(\''.$ESTADO.'\', "RESTORE");';
>> $JMOL .= 'jmolButton("",
>> "RESTORE");';
>>
>> The above don't work so how should I actually do it? Thanks for all this
>> help and sorry again for being quite slow with this...
>> Daniel
>>
>>
>>
>>
>> --
>> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
>> The must-attend event for mobile developers. Connect with experts.
>> Get tools for creating Super Apps. See the latest technologies.
>> Sessions, hands-on labs, demos & much more. Register early & save!
>> http://p.sf.net/sfu/rim-blackberry-1
>> ___
>> Jmol-users mailing list
>> Jmol-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>
>
> 

Re: [Jmol-users] save a Jmol session in a file to be restored afterwards

2011-08-07 Thread Paul Pillot
Daniel,
I'm not a good programmer enough to know what's wrong with your code just with 
those informations (it looks OK to me).
When I want to debug my code with php I do the following :
- run the php page
- right click on the page and view source
- try to locate in the HTML source where php inserts the computed content and 
see what's wrong there.
I don't know from what you say if the php executes correctly, or if the HTML is 
wrong or if there is a problem with the way jmol scripts are sent to jmol ?
Paul

Le 7 août 2011 à 13:14, Daniel Carbajo a écrit :

> Thanks for the fast response Paul, I use floating boxes and a php function 
> called centerbox to echo the contents of $JMOL, so it actually looks like 
> this:
> $title1="Jmol view";
> $JMOL = "
>   jmolInitialize(\"Jmol-12new\", true);
>   jmolSetAppletColor(\"white\");
>   var jmolcmds = [
>   \"load $jmolfile\",
>   \"set frank off; select all; hbonds off; spin off; wireframe 
> off; spacefill off; trace off; set ambient 40; set specpower 40; slab off; 
> ribbons off; cartoons off; label off; monitor off\",
>   \"set isosurfacePropertySmoothing TRUE\",
>   ...
>   \"script Jmol-12new/myJMOLfunctions.spt\",
>   \"javascript appletLoaded()\"
>   ];
>   jmolApplet([450,450], jmolcmds.join(\"; \"));
> ";
> 
> $JMOL .= "jmolButton(\"reset\", \"Original orientation\");
>   jmolButton(\"move 360 0 0 0 0 0 0 0 20\", \"Rotate X axis\");
>   jmolButton(\"move 0 360 0 0 0 0 0 0 20\", \"Rotate Y axis\");
>   jmolButton(\"write image.png\", \"Create image\");
> ";
> centerbox($title1, $JMOL "#99");
> 
> ...where centerbox is:
> function centerbox( $title, $contenuto, $color ) {
>   echo "\n".
>" 2px solid;\"> $title ".
>" \n".
>$contenuto.
>"";
> }
> 
> 
> In any case, I want a "Restore" button just beneath the other buttons, or, 
> even better, to run $ESTADO directly with JmolScript and no clicking... I 
> have tried several ways, including the one you suggest, but it does 
> nothing... any clue? So how do I use $ESTADO (which is correct in terms that 
> it includes all the information as I have echoed it) to restore the state? 
> Thanks!
> 
> 
> 2011/8/7 Paul Pillot 
> There's a problem with your php.
> A php file can be a standard html file with php code parts included between 
>  tags.
> If you set your php in a variable a $JMOL, then you don't have to use the 
>  syntax so the first option is the good one.
> But I think there is something wrong in the statement of your first line with 
> the quotes you use, either simple or double ones. You should use
> $JMOL .= 'jmolButton('''.$ESTADO.'", "RESTORE");';
> Try to debug that in php (echo $JMOL) and look at what it looks like in the 
> resulting HTML code. If your HTML is correct then the problem might be with 
> the script you pass to Jmol.
> Paul
> 
> Le 7 août 2011 à 12:41, Daniel Carbajo a écrit :
> 
>> OK I am completely lost with this actually... I am sorry for being quite 
>> dumb but I just don't get it.
>> I already have the output of jmolGetPropertyAsString("stateInfo") in a PHP 
>> variable called $ESTADO in my Second PHP Page (where I have to restore the 
>> state), so how do I actually restore the state using that variable? I have 
>> tried the following with 0 success:
>> $JMOL .= 'jmolButton(\''.$ESTADO.'\', "RESTORE");';
>> $JMOL .= 'jmolButton("", "RESTORE");';
>> 
>> The above don't work so how should I actually do it? Thanks for all this 
>> help and sorry again for being quite slow with this...
>> Daniel   
> 
> 
> --
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
> 
> 
> --
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts. 
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users

--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with 

Re: [Jmol-users] save a Jmol session in a file to be restored afterwards

2011-08-07 Thread Daniel Carbajo
Thanks for the fast response Paul, I use floating boxes and a php function
called centerbox to echo the contents of $JMOL, so it actually looks like
this:
$title1="Jmol view";
$JMOL = "
jmolInitialize(\"Jmol-12new\", true);
jmolSetAppletColor(\"white\");
var jmolcmds = [
\"load $jmolfile\",
\"set frank off; select all; hbonds off; spin off; wireframe off; spacefill
off; trace off; set ambient 40; set specpower 40; slab off; ribbons off;
cartoons off; label off; monitor off\",
\"set isosurfacePropertySmoothing TRUE\",
...
\"script Jmol-12new/myJMOLfunctions.spt\",
\"javascript appletLoaded()\"
];
jmolApplet([450,450], jmolcmds.join(\"; \"));
";

$JMOL .= "jmolButton(\"reset\", \"Original orientation\");
jmolButton(\"move 360 0 0 0 0 0 0 0 20\", \"Rotate X axis\");
jmolButton(\"move 0 360 0 0 0 0 0 0 20\", \"Rotate Y axis\");
jmolButton(\"write image.png\", \"Create image\");
";
centerbox($title1, $JMOL "#99");

...where centerbox is:
function centerbox( $title, $contenuto, $color ) {
echo "\n".
 " $title ".
 " \n".
 $contenuto.
 "";
}


In any case, I want a "Restore" button just beneath the other buttons, or,
even better, to run $ESTADO directly with JmolScript and no clicking... I
have tried several ways, including the one you suggest, but it does
nothing... any clue? So how do I use $ESTADO (which is correct in terms that
it includes all the information as I have echoed it) to restore the state?
Thanks!


2011/8/7 Paul Pillot 

> There's a problem with your php.
> A php file can be a standard html file with php code parts included between
>  tags.
> If you set your php in a variable a $JMOL, then you don't have to use the
>  syntax so the first option is the good one.
> But I think there is something wrong in the statement of your first line
> with the quotes you use, either simple or double ones. You should use
> $JMOL .= 'jmolButton(''*'*.$ESTADO.'", "RESTORE");';
> Try to debug that in php (echo $JMOL) and look at what it looks like in the
> resulting HTML code. If your HTML is correct then the problem might be with
> the script you pass to Jmol.
> Paul
>
> Le 7 août 2011 à 12:41, Daniel Carbajo a écrit :
>
> OK I am completely lost with this actually... I am sorry for being quite
> dumb but I just don't get it.
> I already have the output of jmolGetPropertyAsString("stateInfo") in a PHP
> variable called $ESTADO in my Second PHP Page (where I have to restore the
> state), so how do I actually restore the state using that variable? I have
> tried the following with 0 success:
> $JMOL .= 'jmolButton(\''.$ESTADO.'\', "RESTORE");';
> $JMOL .= 'jmolButton("",
> "RESTORE");';
>
> The above don't work so how should I actually do it? Thanks for all this
> help and sorry again for being quite slow with this...
> Daniel
>
>
>
>
> --
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos & much more. Register early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Translations for Jmol 12.2

2011-08-07 Thread Nicolas Vervelle
Hi,

I have just released Jmol 12.2.RC2 on
sourceforge
.
I think a few more strings have been added again.

Nico

On Fri, Jul 29, 2011 at 11:42 PM, Nicolas Vervelle wrote:

> Hi,
>
> Jmol 12.2.RC1 is now available on 
> sourceforge
> .
> A few strings have been added since my previous mail, waiting for
> translations :)
>
> Nico
>
>
> On Sun, Jul 24, 2011 at 10:41 PM, Nicolas Vervelle wrote:
>
>> Hi everyone,
>>
>> Bob is starting to prepare Release Candidates for Jmol 12.2.
>> If you're interested in updating the translation of Jmol in any language,
>> you can do it on launchpad.
>> https://translations.launchpad.net/jmol/trunk
>>
>> Currently, only Ukrainian is 100% translated
>>
>> Nico
>>
>
>
--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] save a Jmol session in a file to be restored afterwards

2011-08-07 Thread Paul Pillot
There's a problem with your php.
A php file can be a standard html file with php code parts included between 
 tags.
If you set your php in a variable a $JMOL, then you don't have to use the  syntax so the first option is the good one.
But I think there is something wrong in the statement of your first line with 
the quotes you use, either simple or double ones. You should use
$JMOL .= 'jmolButton('''.$ESTADO.'", "RESTORE");';
Try to debug that in php (echo $JMOL) and look at what it looks like in the 
resulting HTML code. If your HTML is correct then the problem might be with the 
script you pass to Jmol.
Paul

Le 7 août 2011 à 12:41, Daniel Carbajo a écrit :

> OK I am completely lost with this actually... I am sorry for being quite dumb 
> but I just don't get it.
> I already have the output of jmolGetPropertyAsString("stateInfo") in a PHP 
> variable called $ESTADO in my Second PHP Page (where I have to restore the 
> state), so how do I actually restore the state using that variable? I have 
> tried the following with 0 success:
> $JMOL .= 'jmolButton(\''.$ESTADO.'\', "RESTORE");';
> $JMOL .= 'jmolButton("", "RESTORE");';
> 
> The above don't work so how should I actually do it? Thanks for all this help 
> and sorry again for being quite slow with this...
> Daniel

--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] save a Jmol session in a file to be restored afterwards

2011-08-07 Thread Daniel Carbajo
OK I am completely lost with this actually... I am sorry for being quite
dumb but I just don't get it.
I already have the output of jmolGetPropertyAsString("stateInfo") in a PHP
variable called $ESTADO in my Second PHP Page (where I have to restore the
state), so how do I actually restore the state using that variable? I have
tried the following with 0 success:
$JMOL .= 'jmolButton(\''.$ESTADO.'\', "RESTORE");';
$JMOL .= 'jmolButton("",
"RESTORE");';

The above don't work so how should I actually do it? Thanks for all this
help and sorry again for being quite slow with this...
Daniel


2011/8/5 Robert Hanson 

>
>
> On Thu, Aug 4, 2011 at 3:31 AM, Daniel Carbajo 
> wrote:
>
>> Thanks! I start to understand how this works but I have one problem: I
>> cannot pass the jmolGetPropertyAsString("stateInfo") information from one
>> php page to another... I have tried the following with no success:
>>
>> First php:
>> > value='jmolGetPropertyAsString("stateInfo")'>
>>
>
>
> That won't work, because all you are doing is sending the value. What you
> have to do is do this in JavaScript when the time comes to send the second
> PHP request:
>
>
> First php:
> 
> Then, when the time comes:
>
> document.getElementById("state").value=jmolGetPropertyAsString("stateInfo")
> --then the submit()---
>
>
> Bob
>
>
>>
>> Second php:
>> $STATE=$_POST["STATE"];
>> echo "$STATE";
>>
>> But I get just the command, not the value... So how do you send it to the
>> new page? I am quite new to all this, sorry. And thanks a lot again!
>> Yours,
>> Daniel
>>
>>
>>
>>
>>
>> 2011/8/3 Robert Hanson 
>>
>>> Daniel,
>>>
>>> Yes, jmolGetPropertyAsString("stateInfo") returns the exact information
>>> to use to retrieve the exact state. This is what
>>> http://chemapps.stolaf.edu/jmol/docs/examples-12/JmolPopup.htm uses. If
>>> it does not reproduce the EXACT state, I want to know. (The only caveat is
>>> that labels can move if displayed in an applet that has a different size.)
>>> To use it, just run it with
>>>
>>> script [that filename]
>>>
>>> or send it to the new page as part of the page (I like to use <--
>>> /Jmol Embedded Script      **/ --> comments in the HTML and then
>>> just send the whole page to Jmol with JmolScript (grabbing that with
>>> document.getElementById(...).innerHTML. That works amazingly well, and you
>>> don't have to escape anything. The necessary term is
>>>
>>> / Jmol Embedded Script 
>>>
>>> If Jmol finds that in a file, it reads only the data between that and
>>>
>>> **/
>>>
>>> and skips everything else in the file.
>>>
>>>
>>>
>>> On Wed, Aug 3, 2011 at 10:32 AM, Daniel Carbajo <
>>> daniel.carb...@gmail.com> wrote:
>>>
 The point is that I have a page where I can load many proteins, change
 them from cartoon to spacefill to whatever, highlight residues in
 wireframe... and then I have a button which redirects to another page which
 is similar, but with different proteins, which are actually the same ones
 but with temperature factor records changed with other descriptors... In
 this second page I want to restore all the settings from the previous
 (proteins loaded, whether they are in cartoon, spacefill, etc., residues
 highlighted, orientation...).
 Which do you think would be the best way to do so?
 Does jmolGetPropertyAsString("stateInfo") return all that information?
 If so, I am not so sure where to put it so it can be used by the second
 page...
 This is my first attempt in php:
 $content .= "CHECK";
 But I do not want a button and an alert... besides the output is cut so
 I do not get to see everything that jmolGetPropertyAsString("stateInfo")
 returns... Any suggestions?
 Thanks again,
 Daniel







 2011/8/3 Rolf Huehne 

> On 08/03/2011 03:04 PM, Daniel Carbajo wrote:
> > Hello everyone,
> > is it possible to save a Jmol session in terms of proteins loaded,
> their
> > displays (cartoon, spacefill...), residues selected, labels, etc. in
> one php
> > page so everything is restored in another? Can I save the session
> > specifications into a file that is read by another php page? I am
> trying
> > with save/restore ORIENTATION saveName, but does not seem to be
> working.
> The "save state" command does this.
> (see
>
> http://jena3d.fli-leibniz.de/ImgLibPDB/Jena3D/doc/jmol_scripting/index.htm#save
> )
>
> But you will need the "signed" Jmol applet to be able to write it
> directly into a file.
>
> With the "unsigned" Jmol applet you can open the Jmol console, display
> the state (by clicking on a button) and copy+paste the state into a
> text
> editor and save it into a file.
> But depending on the combination of Java, browser and operating system
> version there might be copy+paste problems.
>
> With both applet types you could read the

Re: [Jmol-users] jmolApplet tempo problem

2011-08-07 Thread Daniel Carbajo
Thanks Bob, sorry for not answering before I was travelling... I think I
miss something... what you say is exactly what I do above right?

I run the applet with:
$JMOL = "
jmolInitialize(\"Jmol-12new\", true);
jmolSetAppletColor(\"white\");
var jmolcmds = [
\"load $jmolfile\",
\"set frank off; select all; hbonds off; spin off; wireframe off; spacefill
off; trace off; set ambient 40; set specpower 40; slab off; ribbons off;
cartoons off; label off; monitor off\",
\"set isosurfacePropertySmoothing TRUE\",
...
\"script Jmol-12new/myJMOLfunctions.spt\",
\"javascript appletLoaded()\"
];
jmolApplet([450,450], jmolcmds.join(\"; \"));
";

foreach ($AllResidues as $residue){
if (array_key_exists($residue, $SelectedResiduesHash)){
 echo "appletLoaded(\"$residue\")";
}



And the function appletLoaded looks like:


function appletLoaded(res){
if (res){
var state=jmolGetPropertyAsString(\"stateInfo\");
alert(res + ' --- ' + state);
}
}



In the example I am trying I have 3 residues in $SelectedResiduesHash, so I
get 3 alerts with the appletLoaded function, but I only get the stateinfo
correctly for the last 2 residues, for the first one its value is 'null',
which I think indicates that the applet has not finished loading, right? In
fact I get the same result when I just remove the \"javascript
appletLoaded()\" line, so there is obviously something I am doing wrong...
any idea? Thanks a lot Bob!
Daniel



2011/8/5 Robert Hanson 

> The basic scheme is what you have there:
>
> JmolApplet(.,"... javascript appletLoaded()")
>
> then your appletLoaded function will be called, and you can add JmolScript
> or JmolGetPropertyAsArray commands then to that. You must not try to contact
> Jmol until it is ready. Also, in the latest version of Jmol, we have
>
> set readyCallback 
>
> which specifically calls you back when the applet is ready. Note, however,
> that this event is sent BEFORE  the script is executed, not after.
>
> Bob
>
>
>
> On Fri, Aug 5, 2011 at 11:26 AM, Daniel Carbajo 
> wrote:
>
>> Dear everyone,
>> the problem I have is the following:
>> I load a structure in an applet and I check in a hash some residues that I
>> put in wireframe by default. Since this second command is sent by
>> jmolScriptWait just after jmolApplet, it does not succeed as the applet
>> takes time to be built. There is a partial solution here
>> http://jmol.sourceforge.net/jslibrary/index.en.html#jmolApplet but I
>> cannot make it work, it reads:
>>
>> *Note*:
>> It takes some time to build the applet, so if you put some immediate
>> action like jmolScript() or jmolLoadInline() right after the jmolApplet() 
>> line,
>> it will probably fail because it will be called before the applet has
>> finished loading. There are two alternatives that will work:
>>
>>- Put the commands inside the call to jmolApplet() (its 2nd argument,
>>script).
>>- Have the browser wait until the applet reports to be finished. To do
>>so, put this at the end of the script sent with applet creation: 
>> javascript
>>appletLoaded(); and define a JavaScript function calledappletLoaded() (or
>>any other name you like) that will trigger any further commands.
>>
>>
>>
>>
>> I try the second solution since I have to check the residues in the hash,
>> so I do the following (instead of the putting the residue in wireframe I
>> alert the state, so I can see if the applet has already loaded):
>>
>> 
>> function JmolCargado(res){
>> if (res){
>> var state=jmolGetPropertyAsString(\"stateInfo\");
>>  alert(res + ' --- ' + state);
>> }
>> }
>> 
>>
>>
>>
>>
>> $JMOL = "
>> jmolInitialize(\"Jmol-12new\", true);
>>  jmolSetAppletColor(\"white\");
>> var jmolcmds = [
>> \"load $jmolfile\",
>>  \"set frank off; select all; hbonds off; spin off; wireframe off;
>> spacefill off; trace off; set ambient 40; set specpower 40; slab off;
>> ribbons off; cartoons off; label off; monitor off\",
>>  \"set isosurfacePropertySmoothing TRUE\",
>> \"set showAxes true\",
>>  \"frame all\",
>> \"display all\",
>> \"select 1.1; cartoon; set propertyColorScheme 'bwr'; color atoms property
>> temperature ABSOLUTE $range\",
>>  \"set perspectiveModel 10\",
>> \"set zoomLarge off\",
>>  \"move 0 0 0 50 0 0 0 0 2\",
>> \"script Jmol-12new/myJMOLfunctions.spt\",
>>  \"javascript appletLoaded()\"
>> ];
>> jmolApplet([450,450], jmolcmds.join(\"; \"));
>> ";
>>
>>
>> foreach ($AllResidues as $residue){
>> if (array_key_exists($residue, $SelectedResiduesHash)){
>>  echo "> type=\"text/javascript\">JmolCargado(\"$residue\")";
>> }
>>
>>
>> It works just partially... I have 3 residues in $SelectedResiduesHash so I
>> get 3 alerts (plus one of the line javascript appletLoaded() I don't know
>> why, but I filter it in the javascript function with if(res)); however, the
>> first alert prints a 'null' as the variable 'state' value, which highlights
>> the fact that the command is run BEFORE the applet actually finishes
>> loading. I would really appreciate some help on this... Thank