[Jmol-users] Branch within problem persists

2008-08-29 Thread Steven R. Spilatro
Bob,
Thanks again.  Sorry to give the impression that I had failed to 
remove the quotation marks.  I had tried that without success and so 
then attempted to use verbatim the script from #52 on the Jmol 
examples web page which gives:
select @{within(branch,{[ala]4.N}, {[ala]4.CA})};selectionHalos on;
I tried with and without quotations.  Although I understand now that 
quotation marks and @{} are not needed, I guess am confused about why 
this works in the Jmol examples page.  I'm clearly missing something important!

At any rate, the suggested script that you have given is giving the 
following response with jmol-11-6-RC10.

select within(branch,{4.N},{4.ca}); color atoms blue
pending
0 atoms selected
Script completed
Jmol script terminated

And as a variation:

select within(branch,{atomno=16},{atomno=17}); color atoms blue
pending
0 atoms selected
Script completed
Jmol script terminated

If I cut and paste these scripts into the console for Jmol examples 
#52 they work fine.

Steve


You have the quotes there still. The word branch cannot be in quotes.
Check the documentation. There are several entities atoms might be within,
including

element
chain
group
structure
branch
molecule
model
boundbox

Quotes are used to indicate a sequence, such as RGGGAA, not one of these
keywords.

You want:


select  within (branch, { [ALA] and 4 and *.N } , { [ALA] and 4 and *.ca } )

the @{} is unnecessary as well. The SELECT command requires an atom
expression, so adding the evaluate expression motif, @{...}, is not
needed.

I'm sure that will work. I'm 99% sure there is no bug here.

You can simplify this further by dropping the [ALA], unless there are
several chains and it just so happens that the 4th residue of some other
chain is not ALA. Simpler would be:

select  within (branch, { 4.N } , { 4.ca } )


On Thu, Aug 28, 2008 at 8:19 PM, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:

  Bob,
 
  Thanks for your reply concerning my problem getting getting the Branch
  option of Within to work with jmol-11-6-RC10. I've tried further to resolve
  this but without success. Removing the quotes around branch didn't work, so
  I've gone to a more direct approach of trying to replicate the functionality
  on the Examples-11 page using your ala_5_180_0.pdb file.  With this file
  loaded, if I use the console to send the command:
 
  select @{within(branch,{[ala]4.N}, {[ala]4.CA})} (with or without
  quatation marks)
 
  I'm still getting the error message:
 
  script ERROR: invalid argument
  line 1 command 1 of file null:
   select  @ { within ( branch , { [ALA] and 4 and *.N } , { [ALA]
  and 4 and *.ca }  )  }
 
 
  Still nervous that I'm missing something obvious, but further help would be
  appreciated.



Dr. Steven R. Spilatro
Department of Biology and Environmental Science
Marietta College



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Branch within problem persists

2008-08-29 Thread Robert Hanson
Well, I don't know... Please send the file for which this is a problem and
also the state script from

show state

just prior to giving that command. Here's what I see using the application:

load =1crn
select within(branch,{4.N},{4.ca})
326 atoms selected


Are you using the application or the applet? The fact that you are seeing
pending suggests to me that this is not 11.6.RC10. As I recall, I removed
that message some revisions back. Or, at least, I'm not seeing that message
anymore.

Bob



On Fri, Aug 29, 2008 at 8:27 AM, Steven R. Spilatro
[EMAIL PROTECTED]wrote:

 Bob,
 Thanks again.  Sorry to give the impression that I had failed to
 remove the quotation marks.  I had tried that without success and so
 then attempted to use verbatim the script from #52 on the Jmol
 examples web page which gives:
 select @{within(branch,{[ala]4.N}, {[ala]4.CA})};selectionHalos on;
 I tried with and without quotations.  Although I understand now that
 quotation marks and @{} are not needed, I guess am confused about why
 this works in the Jmol examples page.  I'm clearly missing something
 important!

 At any rate, the suggested script that you have given is giving the
 following response with jmol-11-6-RC10.

 select within(branch,{4.N},{4.ca}); color atoms blue
 pending
 0 atoms selected
 Script completed
 Jmol script terminated

 And as a variation:

 select within(branch,{atomno=16},{atomno=17}); color atoms blue
 pending
 0 atoms selected
 Script completed
 Jmol script terminated

 If I cut and paste these scripts into the console for Jmol examples
 #52 they work fine.

 Steve


 You have the quotes there still. The word branch cannot be in quotes.
 Check the documentation. There are several entities atoms might be
 within,
 including

 element
 chain
 group
 structure
 branch
 molecule
 model
 boundbox

 Quotes are used to indicate a sequence, such as RGGGAA, not one of these
 keywords.

 You want:


 select  within (branch, { [ALA] and 4 and *.N } , { [ALA] and 4 and *.ca }
 )

 the @{} is unnecessary as well. The SELECT command requires an atom
 expression, so adding the evaluate expression motif, @{...}, is not
 needed.

 I'm sure that will work. I'm 99% sure there is no bug here.

 You can simplify this further by dropping the [ALA], unless there are
 several chains and it just so happens that the 4th residue of some other
 chain is not ALA. Simpler would be:

 select  within (branch, { 4.N } , { 4.ca } )


 On Thu, Aug 28, 2008 at 8:19 PM, [EMAIL PROTECTED] 
 [EMAIL PROTECTED] wrote:

   Bob,
  
   Thanks for your reply concerning my problem getting getting the Branch
   option of Within to work with jmol-11-6-RC10. I've tried further to
 resolve
   this but without success. Removing the quotes around branch didn't work,
 so
   I've gone to a more direct approach of trying to replicate the
 functionality
   on the Examples-11 page using your ala_5_180_0.pdb file.  With this file
   loaded, if I use the console to send the command:
  
   select @{within(branch,{[ala]4.N}, {[ala]4.CA})} (with or without
   quatation marks)
  
   I'm still getting the error message:
  
   script ERROR: invalid argument
   line 1 command 1 of file null:
select  @ { within ( branch , { [ALA] and 4 and *.N } , { [ALA]
   and 4 and *.ca }  )  }
  
  
   Still nervous that I'm missing something obvious, but further help would
 be
   appreciated.



 Dr. Steven R. Spilatro
 Department of Biology and Environmental Science
 Marietta College



 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 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
Northfield, MN
http://www.stolaf.edu/people/hansonr


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
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] problem in firefox

2008-08-29 Thread Robert Hanson
mosty I think you will find that the jmolGetStatus() business won't be
helpful. I'm probably the only who ever used that. It was an early attempt
to get around callbacks, and I can't think of any good reason to use it now.


Try something else, like the following:

alert(jmolGetPropertyAsString(auxiliaryinfo, , divInc))


For getting that property, these days I just use:

var x = jmolEvaluate('getProperty(auxiliaryInfo.zeroPoint)')

rather than doing all the translation of the auxiliaryInfo array into
JavaScript just to get that one element.

But you are using Jmol 11.6.RC6 -- be sure to upgrade that to 11.6.RC11.

Bob







On Thu, Aug 28, 2008 at 11:00 PM, Jeff Hansen [EMAIL PROTECTED] wrote:

 Thanks Bob.  If gas prices weren't so high and my family wouldn't miss me
 too much I would take you up on the offer.
 Of course jmolScriptWait didn't break anything, just my failed attempts to
 use it broke something.

 I tried your second alternative (callbacks are still a mystery to me
 although that code doesn't look too bad).  So after loading the file I
 called a function.

 this.loadString = load ../Jmol/jmol/Models/ + molecule + ;javascript
 myFunc();;
 divWrite(divID,jmolApplet(400, this.loadString,divInc));

 In the function I tried to use jmolGetStatus.

 function myFunc(){
 var result = jmolGetStatus(scriptStatus,divInc);
 alert(result);
 }

 As with all of my attempts thus far this displayed undefined.  I guess I
 still don't get how this works.

 I think ultimately I will put the load command along with some other
 commands in a script file rather than continuing to make these long (and
 going to get longer) strings.

 I'm making progress and having fun.  Does that make me a geek?

 Thanks for the help and encouragement.

 You can see how far I've come at
 http://web.mac.com/jhansen4/Jmol/NewJmolDivSTD.html.


 Jeff

 ***
 Jeff Hansen
 Department of Chemistry and Biochemistry
 DePauw University
 602 S. College Ave.
 Greencastle, IN 46135
 [EMAIL PROTECTED]
 ***


 On Aug 28, 2008, at 10:47 PM, Robert Hanson wrote:

 Jeff, why don't you come over to St. Olaf and I'll show you how this works!
 :)
 Seriously, hang in there. You are trying to do a lot all at once, and you
 will catch on. This is precisely what this list is for. Just keep at it.

 jmolScriptWait would not break anything.

 jmolScriptWait should only be used if you absolutely have to pause the
 JavaScript until that operation is complete. There are times this is
 necessary, but it's not a great idea.

 Most Jmol commands are given asynchronously using jmolScript() rather
 than jmolScriptWait(). Jmol has a built-in queuing system, so you can fire
 as many commands at it as you wish, and they will be processed in order as
 processing becomes available. You can also clear the queue using

   !exit

 and you can abort a specifically running script (but continue processing
 later scripts) using

   !quit

 An alternative to waiting is to have the issued script notify the web page
 when it is complete. Eric Martz and Tim Driscoll masterminded this idea
 using scriptcallback methods that see a comment go by and then know it is
 time to do something. Something like this:

   set scriptcallback myfunc;set debugscript true;load whatever;#--file is
 loaded

 then myfunc() gets a message every time a script command is executed, and
 the #--file is loaded message comes through as well:

 function myfunc(app, msg) {
   var s =  + msg  // converts Java string msg into a JavaScript string
   if (s.indexOf(#--file is loaded) == 0) {
 [do something]
   }
 }


 Alternatively, I've used the following quite effectively:

   jmolScript(load whatever;javascript modelLoaded())

 That would run the JavaScript function

 function modelLoaded() {

 }

 as soon as the model is loaded.

 Basically, good event driven code is asynchronous. Nothing waits for
 anything. Things happen because they get a message that they need to happen.
 The more you can do that, the better.

 Still, I do use jmolScriptWait() myself at times. Also jmolEvaluate() is
 synchronous, and I use that a lot as well.

 Bob





 On Thu, Aug 28, 2008 at 6:30 PM, Jeff Hansen [EMAIL PROTECTED] wrote:

 I tried jmolScriptWait but couldn't get it to not break the load
 command.


 ***
 Jeff Hansen
 Department of Chemistry and Biochemistry
 DePauw University
 602 S. College Ave.
 Greencastle, IN 46135
 [EMAIL PROTECTED]
 ***


 On Aug 28, 2008, at 6:03 PM, Jeff Hansen wrote:

  Sorry I wasn't clear about this, but the applet corresponding to
  result1 is loaded when the page loads.  I'll try jmolScriptWait to see
  if that does anything for the result2.
 
  f
  ***
  Jeff Hansen
  Department of Chemistry and Biochemistry
  DePauw University
  602 S. College Ave.
  Greencastle, 

Re: [Jmol-users] problem in firefox

2008-08-29 Thread Jeff Hansen
I guess I really didn't need the jmolGetStatus() I just wanted some  
way to check that the applet was being loaded and I could communicate  
with it.  I'll just forget using that.


Getting the zeroPoint wasn't too bad.  This is what I did.

var _dataInfo = jmolGetPropertyAsArray(auxiliaryInfo);
var _jmolText = document.getElementById('jmolText');
var Energy = _dataInfo['ZEROPOINT'];

Of course your way is more succinct so I'll probably do that from now  
on.  I'm sure it will also be faster.  Grabbing all the auxiliaryInfo  
can take some time.


I'll update to RC11 today.  Changes come too fast for me to keep up  
with, which is a good thing.



***
Jeff Hansen
Department of Chemistry and Biochemistry
DePauw University
602 S. College Ave.
Greencastle, IN 46135
[EMAIL PROTECTED]
***


On Aug 29, 2008, at 10:40 AM, Robert Hanson wrote:

mosty I think you will find that the jmolGetStatus() business won't  
be helpful. I'm probably the only who ever used that. It was an  
early attempt to get around callbacks, and I can't think of any good  
reason to use it now.


Try something else, like the following:

alert(jmolGetPropertyAsString(auxiliaryinfo, , divInc))


For getting that property, these days I just use:

var x = jmolEvaluate('getProperty(auxiliaryInfo.zeroPoint)')

rather than doing all the translation of the auxiliaryInfo array  
into JavaScript just to get that one element.


But you are using Jmol 11.6.RC6 -- be sure to upgrade that to  
11.6.RC11.


Bob







On Thu, Aug 28, 2008 at 11:00 PM, Jeff Hansen [EMAIL PROTECTED]  
wrote:
Thanks Bob.  If gas prices weren't so high and my family wouldn't  
miss me too much I would take you up on the offer.


Of course jmolScriptWait didn't break anything, just my failed  
attempts to use it broke something.


I tried your second alternative (callbacks are still a mystery to me  
although that code doesn't look too bad).  So after loading the file  
I called a function.


	this.loadString = load ../Jmol/jmol/Models/ + molecule +  
;javascript myFunc();;

divWrite(divID,jmolApplet(400, this.loadString,divInc));

In the function I tried to use jmolGetStatus.

function myFunc(){
var result = jmolGetStatus(scriptStatus,divInc);
alert(result);
}

As with all of my attempts thus far this displayed undefined.  I  
guess I still don't get how this works.


I think ultimately I will put the load command along with some other  
commands in a script file rather than continuing to make these long  
(and going to get longer) strings.


I'm making progress and having fun.  Does that make me a geek?

Thanks for the help and encouragement.

You can see how far I've come at http://web.mac.com/jhansen4/Jmol/NewJmolDivSTD.html 
.



Jeff

***
Jeff Hansen
Department of Chemistry and Biochemistry
DePauw University
602 S. College Ave.
Greencastle, IN 46135
[EMAIL PROTECTED]
***


On Aug 28, 2008, at 10:47 PM, Robert Hanson wrote:

Jeff, why don't you come over to St. Olaf and I'll show you how  
this works! :)
Seriously, hang in there. You are trying to do a lot all at once,  
and you will catch on. This is precisely what this list is for.  
Just keep at it.


jmolScriptWait would not break anything.

jmolScriptWait should only be used if you absolutely have to pause  
the JavaScript until that operation is complete. There are times  
this is necessary, but it's not a great idea.


Most Jmol commands are given asynchronously using jmolScript()  
rather than jmolScriptWait(). Jmol has a built-in queuing system,  
so you can fire as many commands at it as you wish, and they will  
be processed in order as processing becomes available. You can also  
clear the queue using


  !exit

and you can abort a specifically running script (but continue  
processing later scripts) using


  !quit

An alternative to waiting is to have the issued script notify the  
web page when it is complete. Eric Martz and Tim Driscoll  
masterminded this idea using scriptcallback methods that see a  
comment go by and then know it is time to do something. Something  
like this:


  set scriptcallback myfunc;set debugscript true;load whatever;#-- 
file is loaded


then myfunc() gets a message every time a script command is  
executed, and the #--file is loaded message comes through as well:


function myfunc(app, msg) {
  var s =  + msg  // converts Java string msg into a JavaScript  
string

  if (s.indexOf(#--file is loaded) == 0) {
[do something]
  }
}


Alternatively, I've used the following quite effectively:

  jmolScript(load whatever;javascript modelLoaded())

That would run the JavaScript function

function modelLoaded() {

}

as soon as the model is loaded.

Basically, good event driven code is asynchronous. Nothing waits  
for anything. Things happen because they get 

[Jmol-users] branch within problem resolved

2008-08-29 Thread Steven R. Spilatro

Bob,
Bingo! I do feel dumb now. Your comment was the clue I needed:

The fact that you are seeing pending suggests to me that this is 
not 11.6.RC10. As I recall, I removed
that message some revisions back. Or, at least, I'm not seeing that 
message anymore.


I had revised this line:
script language=JavaScript src=../jmol-11-6-RC10/Jmol.js/script
but failed to change the jmolInitialize statement (which loads from a 
different file) to:

jmolInitialize(../jmol-11-6-RC10).  Having done so has resolved the problem.
Sorry for distracting you from other more important issues.  I really 
appreciate all of your work and readiness to help us users.

Steve






Dr. Steven R. Spilatro
Department of Biology and Environmental Science
Marietta College
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] a related popup window question....

2008-08-29 Thread Thomas Stout
Thanks Angel --

Yes, it definitely turned out to be a memory issue.  My inexperience is
another!  I was stumped since the Jmol graphic stopped responding, but Jmol
itself was still running and doing stuff -- I could still enter commands
into the console and get appropriate responses.  Now I know that that is a
hallmark of Java exceptions, including out-of-memory errors.

With regard to large windows and the memory issue, I've settled here on
creating a pop-up window that is large enough for end-users to have a big
view but which is fixed in size so that I know that it won't immediately
eat up all of the memory.  I've given up the ability for them to re-size,
but it seems a reasonable trade-off.

Thanks very much,
Tom

On Thu, Aug 28, 2008 at 11:13 AM, Angel Herráez [EMAIL PROTECTED]wrote:

 Hi Tom

 I'm probably late in joining this thread, but since there has been no final
 comment, here's
 my 2 cents

 1)
 Your problem looks to me as more related to a specific browser and JVM that
 to Jmol
 version (but I may be wrong). Of course, memory is an issue.

 2)
  i) be able to stipulate the size of the popup Applet and have it be a
 fixed size, or

 You can always specify a fixed size applet; if the user maximizes the
 window, he will see
 blank space around the applet. (But it's great to be able to increase the
 applet size at will;
 maybe you could include a warning in yor pop-up window; after all, the
 memory allocated to
 Java is an user option.

 To the point:
jmolApplet(600,script javascript:getState())
 will give you a fixed size, 600 pixels, square applet.

 3)
  is there a means of specifying the size of the popup window and not
 allowing it to be
  resized once created??

 Certainly!
 Say you are using


 woptions=menubar=yes,resizable=1,scrollbars,alwaysRaised,width=600,height=600,left=50
 
 newwin=open(JmolPopup.htm,jmol_+sm,woptions)

 Then, change to

 woptions=menubar=yes,resizable=0,scrollbars,alwaysRaised,width=600,height=600,left=50
 


 4)
  ii) your idea, to have an upper limit on how big it can get.

 I find this very tricky to implement, if even possible.


 5)
  Curiously, the popup window is more resistant to this blanking effect
 using MS IExplorer
  than with Firefox (3.0.1).

 In my experience, Firefox (2.0) implementation of JVM (1.5 - 1.6) is much
 more unstable
 than IE's




 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] a related popup window question....

2008-08-29 Thread Robert Hanson
I've gone ahead and added for Jmol 11.6.RC12 the applet param tag
maximumSize. This can be set to a maximum size for which the height and
width are not allowed to exceed when resizing. I think this will be a more
user-friendly option. The way to invoke it would be

jmolInitialize(...)
jmolSetCallback(maximumSize, 400)
jmolApplet()

It may seem odd to set this using jmolSetCallback(), but jmolSetCallback is
really just a general jmolSetParameter function. I suppose we should add
to Jmol.js

function jmolSetParameter(param, value) {
  jmolSetCallback(param, value)
}

So that's clearer.

I didn't make it settable via a script command because it seems to me more
an aspect of building the applet that the developer might set rather than
something that the user should be able to set on the fly.

Bob


On Fri, Aug 29, 2008 at 12:30 PM, Thomas Stout [EMAIL PROTECTED]wrote:


 Thanks Angel --

 Yes, it definitely turned out to be a memory issue.  My inexperience is
 another!  I was stumped since the Jmol graphic stopped responding, but Jmol
 itself was still running and doing stuff -- I could still enter commands
 into the console and get appropriate responses.  Now I know that that is a
 hallmark of Java exceptions, including out-of-memory errors.

 With regard to large windows and the memory issue, I've settled here on
 creating a pop-up window that is large enough for end-users to have a big
 view but which is fixed in size so that I know that it won't immediately
 eat up all of the memory.  I've given up the ability for them to re-size,
 but it seems a reasonable trade-off.

 Thanks very much,
 Tom

 On Thu, Aug 28, 2008 at 11:13 AM, Angel Herráez [EMAIL PROTECTED]wrote:

 Hi Tom

 I'm probably late in joining this thread, but since there has been no
 final comment, here's
 my 2 cents

 1)
 Your problem looks to me as more related to a specific browser and JVM
 that to Jmol
 version (but I may be wrong). Of course, memory is an issue.

 2)
  i) be able to stipulate the size of the popup Applet and have it be a
 fixed size, or

 You can always specify a fixed size applet; if the user maximizes the
 window, he will see
 blank space around the applet. (But it's great to be able to increase the
 applet size at will;
 maybe you could include a warning in yor pop-up window; after all, the
 memory allocated to
 Java is an user option.

 To the point:
jmolApplet(600,script javascript:getState())
 will give you a fixed size, 600 pixels, square applet.

 3)
  is there a means of specifying the size of the popup window and not
 allowing it to be
  resized once created??

 Certainly!
 Say you are using


 woptions=menubar=yes,resizable=1,scrollbars,alwaysRaised,width=600,height=600,left=50
 
 newwin=open(JmolPopup.htm,jmol_+sm,woptions)

 Then, change to

 woptions=menubar=yes,resizable=0,scrollbars,alwaysRaised,width=600,height=600,left=50
 


 4)
  ii) your idea, to have an upper limit on how big it can get.

 I find this very tricky to implement, if even possible.


 5)
  Curiously, the popup window is more resistant to this blanking effect
 using MS IExplorer
  than with Firefox (3.0.1).

 In my experience, Firefox (2.0) implementation of JVM (1.5 - 1.6) is much
 more unstable
 than IE's




 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the
 world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users



 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 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
Northfield, MN
http://www.stolaf.edu/people/hansonr


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
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world

Re: [Jmol-users] a related popup window question....

2008-08-29 Thread Rolf Huehne
Rolf Huehne wrote:
 Thomas Stout wrote:
 Thanks Angel --

 Yes, it definitely turned out to be a memory issue.  My inexperience is
 another!  I was stumped since the Jmol graphic stopped responding, but Jmol
 itself was still running and doing stuff -- I could still enter commands
 into the console and get appropriate responses.  Now I know that that is a
 hallmark of Java exceptions, including out-of-memory errors.

 With regard to large windows and the memory issue, I've settled here on
 creating a pop-up window that is large enough for end-users to have a big
 view but which is fixed in size so that I know that it won't immediately
 eat up all of the memory.  I've given up the ability for them to re-size,
 but it seems a reasonable trade-off.
 
 Instead of providing an automatic resize function you could provide a
 manual resize option using input fields. This way you could easily set a
 maximum size limit by your Javascript code that does the actual resizing.
 

You wouldn't even need input fields. You could tie for example the
'body' tag with the 'onResize' event to a Javascript function that
resizes the applet with an upper limit.

I just did a similar thing (with a lower limit) a few days ago for our
PDB file viewer:

http://www.fli-leibniz.de/cgi-bin/idb_send-rh.pl?CODE=1dehMIME=html

Regards,
Rolf

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] a related popup window question....

2008-08-29 Thread Rolf Huehne
Thomas Stout wrote:
 Thanks Angel --
 
 Yes, it definitely turned out to be a memory issue.  My inexperience is
 another!  I was stumped since the Jmol graphic stopped responding, but Jmol
 itself was still running and doing stuff -- I could still enter commands
 into the console and get appropriate responses.  Now I know that that is a
 hallmark of Java exceptions, including out-of-memory errors.
 
 With regard to large windows and the memory issue, I've settled here on
 creating a pop-up window that is large enough for end-users to have a big
 view but which is fixed in size so that I know that it won't immediately
 eat up all of the memory.  I've given up the ability for them to re-size,
 but it seems a reasonable trade-off.

Instead of providing an automatic resize function you could provide a
manual resize option using input fields. This way you could easily set a
maximum size limit by your Javascript code that does the actual resizing.

Regards,
Rolf

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] problem in firefox

2008-08-29 Thread Bob Hanson

Must use 11.6.rc11


Sent from my iPhone

On Aug 29, 2008, at 10:14 AM, Jeff Hansen [EMAIL PROTECTED] wrote:


I spoke too soon.


var x = jmolEvaluate('getProperty(auxiliaryInfo.zeroPoint)')



isn't working for me.  It returns an error message about the  
getProperty command.




***
Jeff Hansen
Department of Chemistry and Biochemistry
DePauw University
602 S. College Ave.
Greencastle, IN 46135
[EMAIL PROTECTED]
***


On Aug 29, 2008, at 10:40 AM, Robert Hanson wrote:

mosty I think you will find that the jmolGetStatus() business won't  
be helpful. I'm probably the only who ever used that. It was an  
early attempt to get around callbacks, and I can't think of any  
good reason to use it now.


Try something else, like the following:

alert(jmolGetPropertyAsString(auxiliaryinfo, , divInc))


For getting that property, these days I just use:

var x = jmolEvaluate('getProperty(auxiliaryInfo.zeroPoint)')

rather than doing all the translation of the auxiliaryInfo array  
into JavaScript just to get that one element.


But you are using Jmol 11.6.RC6 -- be sure to upgrade that to  
11.6.RC11.


Bob







On Thu, Aug 28, 2008 at 11:00 PM, Jeff Hansen [EMAIL PROTECTED]  
wrote:
Thanks Bob.  If gas prices weren't so high and my family wouldn't  
miss me too much I would take you up on the offer.


Of course jmolScriptWait didn't break anything, just my failed  
attempts to use it broke something.


I tried your second alternative (callbacks are still a mystery to  
me although that code doesn't look too bad).  So after loading the  
file I called a function.


	this.loadString = load ../Jmol/jmol/Models/ + molecule +  
;javascript myFunc();;

divWrite(divID,jmolApplet(400, this.loadString,divInc));

In the function I tried to use jmolGetStatus.

function myFunc(){
var result = jmolGetStatus(scriptStatus,divInc);
alert(result);
}

As with all of my attempts thus far this displayed undefined.  I  
guess I still don't get how this works.


I think ultimately I will put the load command along with some  
other commands in a script file rather than continuing to make  
these long (and going to get longer) strings.


I'm making progress and having fun.  Does that make me a geek?

Thanks for the help and encouragement.

You can see how far I've come at http://web.mac.com/jhansen4/Jmol/NewJmolDivSTD.html 
.



Jeff

***
Jeff Hansen
Department of Chemistry and Biochemistry
DePauw University
602 S. College Ave.
Greencastle, IN 46135
[EMAIL PROTECTED]
***


On Aug 28, 2008, at 10:47 PM, Robert Hanson wrote:

Jeff, why don't you come over to St. Olaf and I'll show you how  
this works! :)
Seriously, hang in there. You are trying to do a lot all at once,  
and you will catch on. This is precisely what this list is for.  
Just keep at it.


jmolScriptWait would not break anything.

jmolScriptWait should only be used if you absolutely have to pause  
the JavaScript until that operation is complete. There are times  
this is necessary, but it's not a great idea.


Most Jmol commands are given asynchronously using jmolScript()  
rather than jmolScriptWait(). Jmol has a built-in queuing system,  
so you can fire as many commands at it as you wish, and they will  
be processed in order as processing becomes available. You can  
also clear the queue using


  !exit

and you can abort a specifically running script (but continue  
processing later scripts) using


  !quit

An alternative to waiting is to have the issued script notify the  
web page when it is complete. Eric Martz and Tim Driscoll  
masterminded this idea using scriptcallback methods that see a  
comment go by and then know it is time to do something. Something  
like this:


  set scriptcallback myfunc;set debugscript true;load  
whatever;#--file is loaded


then myfunc() gets a message every time a script command is  
executed, and the #--file is loaded message comes through as well:


function myfunc(app, msg) {
  var s =  + msg  // converts Java string msg into a JavaScript  
string

  if (s.indexOf(#--file is loaded) == 0) {
[do something]
  }
}


Alternatively, I've used the following quite effectively:

  jmolScript(load whatever;javascript modelLoaded())

That would run the JavaScript function

function modelLoaded() {

}

as soon as the model is loaded.

Basically, good event driven code is asynchronous. Nothing waits  
for anything. Things happen because they get a message that they  
need to happen. The more you can do that, the better.


Still, I do use jmolScriptWait() myself at times. Also  
jmolEvaluate() is synchronous, and I use that a lot as well.


Bob





On Thu, Aug 28, 2008 at 6:30 PM, Jeff Hansen [EMAIL PROTECTED]  
wrote:

I tried jmolScriptWait but couldn't get it to not break the load
command.



[Jmol-users] autobond and bond tolerance

2008-08-29 Thread Andrew M. Simms
Has something changed recently with defaults related to autobond.  Ball
and stick structures that were fine in the past seem to end up with nearly
every adjacent atom being bonded to each other (i.e. hydrogens bond to their
carbon as well as to each other) .  

 

Questions:

 

1. What are the default values and typical values for:

 

bondTolerance

minBondDistance

 

and most importantly, what are the units for these (I was surprised the docs
described these as decimal as opposed to decimal in angstroms or something
else)?

 

2. Have later versions of Java possibly caused a change in how these
parameters are initially set?  We've been running with a frozen version of
Jmol on our website and just noticed problems with methyl groups.  Since our
code and data have not changed, Java update seem like the only source of
changes.

 

--Andrew

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] autobond and bond tolerance

2008-08-29 Thread Robert Hanson
1. What are the default values and typical values for:

bondTolerance

  public final static float DEFAULT_BOND_TOLERANCE = 0.45f;

minBondDistance

  //minimum acceptable bonding distance ... from OpenBabel ... mth 2003 05
26
  public final static float DEFAULT_MIN_BOND_DISTANCE = 0.4f;


All specified distance units in Jmol are Angstroms.


2. Have later versions of Java possibly caused a change in how these
parameters are initially set?  We've been running with a frozen version of
Jmol on our website and just noticed problems with methyl groups.  Since our
code and data have not changed, Java update seem like the only source of
changes.

I don't recall anything changing in that regard any time recently. But
perhaps years ago. How old is that version? Send me a file or two so I can
take a look at what you have. Certainly this is very unusual.

Bob Hanson

On Fri, Aug 29, 2008 at 8:59 PM, Andrew M. Simms
[EMAIL PROTECTED]wrote:

  Has something changed recently with defaults related to autobond.  Ball
 and stick structures that were fine in the past seem to end up with nearly
 every adjacent atom being bonded to each other (i.e. hydrogens bond to their
 carbon as well as to each other) .



 Questions:



 1. What are the default values and typical values for:



 bondTolerance

 minBondDistance



 and most importantly, what are the units for these (I was surprised the
 docs described these as decimal as opposed to decimal in angstroms or
 something else)?



 2. Have later versions of Java possibly caused a change in how these
 parameters are initially set?  We've been running with a frozen version of
 Jmol on our website and just noticed problems with methyl groups.  Since our
 code and data have not changed, Java update seem like the only source of
 changes.



 --Andrew

 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 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
Northfield, MN
http://www.stolaf.edu/people/hansonr


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
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


[Jmol-users] proposed change to Jmol.js

2008-08-29 Thread Robert Hanson
I'd like to propose a change to Jmol.js. The change would be an addition.

If the page URL contains JMOLJAR=

then Jmol.js would be instructed to ignore the jmolInitialize() command and
instead use the codebase directory and jar file as defined after that tag.
For example:

http://chemapps.stolaf.edu/jmol/docs/examples-11/new.htm?JMOLJAR=./JmolAppletSigned.jar

This would allow quick checking of sites with different JAR files.

Bob


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


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
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


[Jmol-users] which jmol applet?

2008-08-29 Thread Jeff Hansen
If I use a function like this:

function getEnergy() {
var _jmolText = document.getElementById('jmolText');
var Energy = 
jmolEvaluate('getProperty(auxiliaryInfo.zeroPoint)');
var text = Energy =  + Energy +  kJ/mol\n;
var node = document.createTextNode(text);
_jmolText.appendChild(node);
}

and I have more than one Jmol applet on the page, how do I select  
which applet I'm getting the info from?


***
Jeff Hansen
Department of Chemistry and Biochemistry
DePauw University
602 S. College Ave.
Greencastle, IN 46135
[EMAIL PROTECTED]
***



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users