[Jmol-users] Mol-graphics: Jmol VB ?

2007-03-06 Thread Angel Herraez
[ This follows a post and discussion held partly in jmol-developers 
and partly privately; I am posting it here since it may be of help to 
other users ]

Michael Marden wrote:

 thanks for your comments on the applet size.
 
 In my case Visual Basic (VB) is providing the Web-window and Bob's 
 script is providing communication - via the hard disk.   I  added an 
 explicit VB button (command) to reset the applet to a new size, based on 
 the current window size; this works, but of course resets the molecule.  
 It was not reasonable to do it during resizing, since the round trip to 
 the disk is too slow.
 
 I did try to paste in the suggestion by Angel H.:
 script type=text/javascript
 function resize(n)
 {
 document.getElementById(jmolApplet0).width = n
 document.getElementById(jmolApplet0).height = n
 }
 function resizeCSS(n)
 {
 document.getElementById(jmolApplet0).style.width = n+px
 document.getElementById(jmolApplet0).style.height = n+px
 }
 /script
 
 but I got errors.  Maybe Bob can tell me what exact form I need within 
 the current script he setup. 
 Overall we need an applet size that follows a percentage of the 
 Web-window (without having to pass external messages via the disk).   
 hopefully I can now respond via the Jmol users group.
 thanks again,


Michael, if you just need an applet that is sized a percent of the 
web page window, that can be done easily (I can send you my 
JavaScript code that works). The tricky part is to have the applet 
resize when the browser is resized. As pointed out by Miguel, this 
probably involves too many resize events and can choke Jmol, or the 
browser.
But a per-request resize should also be easy to have.

Please, advise


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Mol-graphics: Jmol VB ?

2007-03-06 Thread Bob Hanson
good call, Angel -- yes, this is a Jmol-user issue, not a developer one, 
since it involves no Jmol code issues.

Michael, if you Google

 apple resize

you will get a number of solutions for automatically resizing an applet 
-- Sounds like Angel has one.

See for example 
http://blog.taragana.com/index.php/archive/resizing-applets-dynamically-within-browser-frames/

It uses something like this (MSIE only here). One trick might be that on 
load the applet may not be fully initiallized. My quick an dirty 
solution based on that JavaScript code is at

http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/resize.htm

Note that I issue

zoomLarge = false

at the beginning of my script --  That's to ensure that as the applet 
resizes the molecule stays within the window.
There's also a hack in there because Jmol.js doesn't support 
proportional size windows. [We should fix that, Angel. Perhaps just 
allowing: jmolApplet([50%,50%]) or jmolApplet(50%) -- I think it's 
one line of code.]

There is no issue of flood Jmol with refreshes. Jmol just ignores a 
resize if it is the same dimensions as it already has.
And if it is currently in the process of refreshing, it ignores a 
refresh request. So that's not an issue. Especially in a
case like this where you know for a fact the browser is MSIE because it 
is a component of your Visual Basic program.

Again, window resizing is standard procedure with the application -- the 
Jmol end of things has been capable of this for a long time. This is 
just the first time anyone has thought about it in terms of the applet.



Angel Herraez wrote:

[ This follows a post and discussion held partly in jmol-developers 
and partly privately; I am posting it here since it may be of help to 
other users ]

Michael Marden wrote:

  

thanks for your comments on the applet size.

In my case Visual Basic (VB) is providing the Web-window and Bob's 
script is providing communication - via the hard disk.   I  added an 
explicit VB button (command) to reset the applet to a new size, based on 
the current window size; this works, but of course resets the molecule.  
It was not reasonable to do it during resizing, since the round trip to 
the disk is too slow.

I did try to paste in the suggestion by Angel H.:
script type=text/javascript
function resize(n)
{
document.getElementById(jmolApplet0).width = n
document.getElementById(jmolApplet0).height = n
}
function resizeCSS(n)
{
document.getElementById(jmolApplet0).style.width = n+px
document.getElementById(jmolApplet0).style.height = n+px
}
/script

but I got errors.  Maybe Bob can tell me what exact form I need within 
the current script he setup. 
Overall we need an applet size that follows a percentage of the 
Web-window (without having to pass external messages via the disk).   
hopefully I can now respond via the Jmol users group.
thanks again,




Michael, if you just need an applet that is sized a percent of the 
web page window, that can be done easily (I can send you my 
JavaScript code that works). The tricky part is to have the applet 
resize when the browser is resized. As pointed out by Miguel, this 
probably involves too many resize events and can choke Jmol, or the 
browser.
But a per-request resize should also be easy to have.

Please, advise


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users
  


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] JmolAppletLite

2007-03-06 Thread Alan Hewat
Sebastian Lisken said:
 Wouldn't it be possible though to split the applet into several Jars and
 arrange for all but the first to be loaded on demand?

Loading only the jar files necessary for the features requested would be
great if it were possible. I can see the point of a Jmol-light, but ADSL
is becoming so ubiquitous (I now watch TV over my telephone line) that
downloading the present Jmol jar file is not a problem even from home.

On the other hand several versions of Jmol would be more difficult to
maintain, and more confusing to users. I already have trouble keeping up
with all the new features, but am looking forward to finding time to try
out the math package.
_
Dr Alan Hewat, ILL Grenoble, FRANCE[EMAIL PROTECTED]fax+33.476.20.76.48
+33.476.20.72.13 (.26 Mme Guillermet)  http://www.ill.fr/dif/people/hewat/
_


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] resize applet with window (was: Mol-graphics: Jmol VB ?)

2007-03-06 Thread Frieda Reichsman
I changed the subject line to make this a bit easier to find in  
future, if someone is looking on the archives - and wow, it works  
beautifully-- what a great enhansonment!  ;^)


Frieda

On Mar 6, 2007, at 7:46 AM, Bob Hanson wrote:

good call, Angel -- yes, this is a Jmol-user issue, not a developer  
one,

since it involves no Jmol code issues.

Michael, if you Google

 apple resize

you will get a number of solutions for automatically resizing an  
applet

-- Sounds like Angel has one.

See for example
http://blog.taragana.com/index.php/archive/resizing-applets- 
dynamically-within-browser-frames/


It uses something like this (MSIE only here). One trick might be  
that on

load the applet may not be fully initiallized. My quick an dirty
solution based on that JavaScript code is at

http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/ 
resize.htm


Note that I issue

zoomLarge = false

at the beginning of my script --  That's to ensure that as the applet
resizes the molecule stays within the window.
There's also a hack in there because Jmol.js doesn't support
proportional size windows. [We should fix that, Angel. Perhaps just
allowing: jmolApplet([50%,50%]) or jmolApplet(50%) -- I think  
it's

one line of code.]

There is no issue of flood Jmol with refreshes. Jmol just ignores a
resize if it is the same dimensions as it already has.
And if it is currently in the process of refreshing, it ignores a
refresh request. So that's not an issue. Especially in a
case like this where you know for a fact the browser is MSIE  
because it

is a component of your Visual Basic program.

Again, window resizing is standard procedure with the application  
-- the

Jmol end of things has been capable of this for a long time. This is
just the first time anyone has thought about it in terms of the  
applet.




Angel Herraez wrote:


[ This follows a post and discussion held partly in jmol-developers
and partly privately; I am posting it here since it may be of help to
other users ]

Michael Marden wrote:




thanks for your comments on the applet size.

In my case Visual Basic (VB) is providing the Web-window and Bob's
script is providing communication - via the hard disk.   I  added an
explicit VB button (command) to reset the applet to a new size,  
based on
the current window size; this works, but of course resets the  
molecule.
It was not reasonable to do it during resizing, since the round  
trip to

the disk is too slow.

I did try to paste in the suggestion by Angel H.:
script type=text/javascript
function resize(n)
{
document.getElementById(jmolApplet0).width = n
document.getElementById(jmolApplet0).height = n
}
function resizeCSS(n)
{
document.getElementById(jmolApplet0).style.width = n+px
document.getElementById(jmolApplet0).style.height = n+px
}
/script

but I got errors.  Maybe Bob can tell me what exact form I need  
within

the current script he setup.
Overall we need an applet size that follows a percentage of the
Web-window (without having to pass external messages via the disk).
hopefully I can now respond via the Jmol users group.
thanks again,





Michael, if you just need an applet that is sized a percent of the
web page window, that can be done easily (I can send you my
JavaScript code that works). The tricky part is to have the applet
resize when the browser is resized. As pointed out by Miguel, this
probably involves too many resize events and can choke Jmol, or the
browser.
But a per-request resize should also be easy to have.

Please, advise


- 


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to  
share your

opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php? 
page=join.phpp=sourceforgeCID=DEVDEV

___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users




-- 
---

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to  
share your

opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php? 
page=join.phpp=sourceforgeCID=DEVDEV

___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


///

Frieda Reichsman, PhD
Molecules in Motion
Interactive Molecular Structures
http://www.moleculesinmotion.com

///


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business 

[Jmol-users] New Window with resizable applet command?

2007-03-06 Thread Nick Greeves
I agree this works well and made me think about how it could be used  
more widely.


In ordinary web pages I often use the Open Link in New Window(Frame)  
feature of my browser (Safari) to create a new window of the content  
I want to scrutinise  in more detail without losing the initial page.  
Or when you click on thumbnail image to see the full size picture


So how about a command for Jmol (and in the menu) that creates a New  
Window with a resizable Jmol frame. That way we can keep small  
windows as embedded items in web pages but have the capability to  
blow them up if required.


All the best
Nick
--
WWW Pages: http://www.liv.ac.uk/Chemistrywww/Staff/greeves.html
Tel: +44 (0)151-794-3506 (3500 secretary)


On 6 Mar 2007, at 13:28, [EMAIL PROTECTED] wrote:


From: Frieda Reichsman [EMAIL PROTECTED]
Subject: Re: [Jmol-users] resize applet with window (was:
Mol-graphics: Jmol   VB ?)
To: jmol-users@lists.sourceforge.net
Cc: Bob Hanson [EMAIL PROTECTED]
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=us-ascii

I changed the subject line to make this a bit easier to find in
future, if someone is looking on the archives - and wow, it works
beautifully-- what a great enhansonment!  ;^)


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


[Jmol-users] Mac: copying from script window of Jmol application?

2007-03-06 Thread Frieda Reichsman

Hi all,

On a Mac it seems impossible to get the wonderful show state text  
out of the script window of the Jmol application. Copy/paste is  
disabled, and drag  drop is impossible because after selecting the  
text, the click inside the script window de-selects the text.


(In terms of how other windows work on Mac, this second click should  
not de-select the text, if the click is held down and the mouse is  
dragged - it should carry the text and drop it into your waiting  
shiny new empty text file window. IOW, it is the difference between a  
mouse-down event and a mouse-up.)


I dug up an old post on the list because I remembered someone saying  
that I could get the output from the Mac OSX Console.app's  
console.log. But the info does not appear in the log.


Anyone solve this mystery already?

Frieda


///

Frieda Reichsman, PhD
Molecules in Motion
Interactive Molecular Structures
http://www.moleculesinmotion.com

///


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


[Jmol-users] Bond lengths valence sum calculation with Jmol?

2007-03-06 Thread Bob Hanson
[Sorry, I am still not getting Jmol-users messages. So I'm slow on the 
take here. I'll look through some recent archives for messages I might 
have something to say about]

Alan, the latest incarnation of Jmol, 11.1.17, includes just the sort of 
thing you want, although not sorted. (Come now, you can do that on your 
own, right? :) )

I will use 11.1.17 syntax since this wouldn't work on earlier versions 
anyway. Basically what you do is:

1) choose bondmodeOR = true or bondmodeOR = false and create a bond 
set for the atoms you are interested in. Then format the label for the 
set anyway you want.


bondmodeOR = true

theBonds = {_Si}.bonds.label(%2a1%-3i1 %2a2%-3i2  %6.3LENGTH)

The code in there is format code


%2a1   atom 1 identifier, 2 characters, right-justified
%-3i2  atom 2 index, 3 characters, left-justified
%6.3LENGTH   bond length set in 6 characters, right-justified, rounded 
to 3 decimal places

(another bond option is %ORDER)

now if you say

message @theBonds

you get your information:

 O11  Si101.605
 O9   Si5 1.614
 O8   Si7 1.605
Si7O2 1.614
Si7O9 1.605
 O6   Si5 1.605
 O4   Si7 1.614
Si3O111.614
Si3O4 1.605
 O2   Si1 1.605

Even easier, using the new Jmol.js jmolEvaluate() funcation (only at St. 
Olaf, I think? -- not sure if this got into the package), on your web 
page use:

var mybonds = new Array()

mybonds = jmolEvaluate('{_Si}.bonds.label(%2a1%-3i1 %2a2%-3i2  
%6.3LENGTH').split(\n)

Then you have them in a nice JavaScript array you can sort anyway you 
want to.

Bob

Alan Hewat
Sun, 25 Feb 2007 09:31:19 -0800

Jmol already calculates bond-lengths to decide which atoms are bonded
according to distance criteria. It would be very nice to be able to output
a list of these bond-lengths, sorted according to central bonded sites.
For example, the output obtained from
http://icsd.ill.fr/icsd/index.php?action=Bondsid[]=72989 
http://icsd.ill.fr/icsd/index.php?action=Bondsid%5B%5D=72989

Then of course it would be an extra bonus to be able to output a list of
the bond angles as well, as can be done from the above URL.

Finally :-) if you have a list of bond lengths, it would be very useful
for inorganic/ionic structures to be able to calculate the bond-valence
sum around the different cations. This is simply the sum of the individual
bond valences = exp((Ro-R)/B) where R is the bond length and Ro and B are
parameters for given cation-anion oxidation states obtained from a look-up
table such as http://icsd.ill.fr/icsd/help/valence.html

The valence states would be extracted from the CIF file, as used for
drawing ionic radii. (Actually in my calculation I have a self-consistency
loop, which assumes intial valence states, calculates the valence sum for
comparison, and then if it is significantly different, uses this new value
as the supposed valence state to select new Ro and B parameters).

The bond valence sum is a very important check on the correctness of a
structure. If it unreasonable then almost certainly something is wrong
(atom coordinates, disorder, stoichiometry etc...)

Alan.
_
Dr Alan Hewat, ILL Grenoble, FRANCE [EMAIL PROTECTED]fax+33.476.20.76.48
+33.476.20.72.13 (.26 Mme Guillermet) http://www.ill.fr/dif/people/hewat/
_


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV 
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

*
  [Jmol-users] Bond lengths  valence sum calculation with Jmol?
  Alan Hewat

*
  Reply via email to


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] a treat for you -- Jmol in motion

2007-03-06 Thread Bob Hanson
you would just add to the script a new connect() command somewhere in 
the loop, being careful only to adjust bonds to the molecule you are 
moving. Yes, that would be cool.


C Anthony Lewis
Wed, 28 Feb 2007 08:18:29 -0800

Bob,

Funky!

I found that with both hydrogen bonds and movement on the H-bonds just
got longer and longer but if the H-bonds were turned off and then on
again another set formed. I'm wondering if its possible to update the
H-bonds as the individual molecules move, i.e. breaking and forming them
on the fly?

Just a thought,

Anthony Lewis

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Mac: copying from script window of Jmol application?

2007-03-06 Thread Frieda Reichsman

Bob,

Would it be possible to have the show script output written into a  
file, similarly to the

write iso myfile.jvxl
command?

Frieda

On Mar 6, 2007, at 9:07 AM, Frieda Reichsman wrote:


Hi all,

On a Mac it seems impossible to get the wonderful show state text  
out of the script window of the Jmol application. Copy/paste is  
disabled, and drag  drop is impossible because after selecting the  
text, the click inside the script window de-selects the text.


(In terms of how other windows work on Mac, this second click  
should not de-select the text, if the click is held down and the  
mouse is dragged - it should carry the text and drop it into your  
waiting shiny new empty text file window. IOW, it is the difference  
between a mouse-down event and a mouse-up.)


I dug up an old post on the list because I remembered someone  
saying that I could get the output from the Mac OSX Console.app's  
console.log. But the info does not appear in the log.


Anyone solve this mystery already?

Frieda


///

Frieda Reichsman, PhD
Molecules in Motion
Interactive Molecular Structures
http://www.moleculesinmotion.com

///


-- 
---

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to  
share your

opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php? 
page=join.phpp=sourceforgeCID=DEVDEV 
___

Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


///

Frieda Reichsman, PhD
Molecules in Motion
Interactive Molecular Structures
http://www.moleculesinmotion.com

///


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


[Jmol-users] Bond lengths valence sum calculation with Jmol?

2007-03-06 Thread Alan Hewat
At 15:47 06/03/2007, Bob Hanson [EMAIL PROTECTED] wrote:
Alan, the latest incarnation of Jmol, 11.1.17, includes just the sort of thing 
you want, although not sorted. (Come now, you can do that on your own, right? 
:) )

Thanks Bob. I thought that it might already be possible with all the new things 
you have implemented. Yes, I should be able to sort the bonds if I have them in 
a nice javascript array, and probably I can also calculate the valence sum from 
them (though I am more familiar with calculations server side than client side).

BTW I was since told that CDC's Mercury CIF molecular viewer 
http://www.ccdc.cam.ac.uk/products/mercury/ although much less powerful than 
Jmol for structure visualisation, especially for inorganics, has bond-lengths 
built in under the MoreInfo menu. It even has powder pattern visualisation, 
which one day I would like to see in Java.

Alan (still catching up on all the new Jmol features).

_
Dr Alan Hewat, ILL Grenoble, FRANCE[EMAIL PROTECTED]fax+33.476.20.76.48
+33.476.20.72.13 (.26 Mme Guillermet)  http://www.ill.fr/dif/people/hewat/
_


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] New Window with resizable applet command?

2007-03-06 Thread Bob Hanson
OK, how about this in Jmol.js:

jmolResize(w,h)

w or h = 1 implies a percent; h missing defaults to w:

jmolResize(500,500)
jmolResize(400)
jmolResize(0.95,0.60)
jmolResize(0.95)

Ah, and here is the nicest part: I've modified Jmol.js to allow for 
percentages as well in the jmolApplet command itself:


jmolApplet(95%)

or

jmolApplet(0.95)

Then the applet automatically resizes, far as I can tell -- tested in 
Firefox, Opera, and IE on a PC. Looks like the browsers properly send 
the information to the applet indicating resizes if the applet 
width/height are given as percentages.

In playing with this, I notice that if the applet is in a DIV, then that 
percent applies only to that div.

What's interesting is that with the capability of saving and restoring 
the state now, we really could do just this -- have a button (on the 
webpage, I think) that captures the state of the applet, designs a new 
window with the appropriate resize functions, and inserts applet code 
into the new window such that the state script is run.

OK, I have that now in 
http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/new.htm

Just click on new applet window under the applet.

Let me know if this does not work.

Bob


Nick Greeves wrote:

 I agree this works well and made me think about how it could be used 
 more widely.

 In ordinary web pages I often use the Open Link in New Window(Frame) 
 feature of my browser (Safari) to create a new window of the content I 
 want to scrutinise  in more detail without losing the initial page. Or 
 when you click on thumbnail image to see the full size picture

 So how about a command for Jmol (and in the menu) that creates a New 
 Window with a resizable Jmol frame. That way we can keep small windows 
 as embedded items in web pages but have the capability to blow them 
 up if required.

 All the best

 Nick

 -- 

 WWW Pages: http://www.liv.ac.uk/Chemistrywww/Staff/greeves.html

 Tel: +44 (0)151-794-3506 (3500 secretary)



 On 6 Mar 2007, at 13:28, [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 From: Frieda Reichsman [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED]

 Subject: Re: [Jmol-users] resize applet with window (was:

 Mol-graphics: Jmol  VB ?)

 To: jmol-users@lists.sourceforge.net 
 mailto:jmol-users@lists.sourceforge.net

 Cc: Bob Hanson [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]

 Message-ID: [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED]

 Content-Type: text/plain; charset=us-ascii


 I changed the subject line to make this a bit easier to find in  

 future, if someone is looking on the archives - and wow, it works  

 beautifully-- what a great enhansonment!  ;^)




-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Mac: copying from script window of Jmol application?

2007-03-06 Thread Bob Hanson
It should appear in the log (along with all sorts of other stuff) if you use

set loglevel 5

But I wonder what the issue is with Macs. Anyway, with the WRITE 
command, you shouldn't have to fool with any of this. But I see that I 
haven't fully realized the CLIPBOARD functionality of that command. 
Right now we only have:

write image clipboard

(Does that work for you, frieda?)


I guess we can have

write isosurface clipboard
write mo clipboard
write state clipboard
write var x clipboard

etc.

... OK, these are all part of Jmol 11.1.18. the code checkin system 
(SVN) is not working for me, so this is to be found at

http://www.stolaf.edu/academics/jmol/docs/examples-11/Jmol.jar


Bob

Frieda Reichsman wrote:

 Hi all,

 On a Mac it seems impossible to get the wonderful show state text 
 out of the script window of the Jmol application. Copy/paste is 
 disabled, and drag  drop is impossible because after selecting the 
 text, the click inside the script window de-selects the text. 

 (In terms of how other windows work on Mac, this second click should 
 not de-select the text, if the click is held down and the mouse is 
 dragged - it should carry the text and drop it into your waiting shiny 
 new empty text file window. IOW, it is the difference between a 
 mouse-down event and a mouse-up.)

 I dug up an old post on the list because I remembered someone saying 
 that I could get the output from the Mac OSX Console.app's 
 console.log. But the info does not appear in the log.

 Anyone solve this mystery already?

 Frieda


 ///


 Frieda Reichsman, PhD

 Molecules in Motion

 Interactive Molecular Structures

 http://www.moleculesinmotion.com


 ///





-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Mac: copying from script window of Jmol application?

2007-03-06 Thread Bob Hanson
It should appear in the log (along with all sorts of other stuff) if you use

set loglevel 5

But I wonder what the issue is with Macs. Anyway, with the WRITE 
command, you shouldn't have to fool with any of this. But I see that I 
haven't fully realized the CLIPBOARD functionality of that command. 
Right now we only have:

write image clipboard

(Does that work for you, frieda?)


I guess we can have

write isosurface clipboard
write mo clipboard
write state clipboard
write var x clipboard

etc.

... OK, these are all part of Jmol 11.1.18. the code checkin system 
(SVN) is not working for me, so this is to be found at

http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/Jmol.jar


Bob

Frieda Reichsman wrote:

 Hi all,

 On a Mac it seems impossible to get the wonderful show state text 
 out of the script window of the Jmol application. Copy/paste is 
 disabled, and drag  drop is impossible because after selecting the 
 text, the click inside the script window de-selects the text. 

 (In terms of how other windows work on Mac, this second click should 
 not de-select the text, if the click is held down and the mouse is 
 dragged - it should carry the text and drop it into your waiting shiny 
 new empty text file window. IOW, it is the difference between a 
 mouse-down event and a mouse-up.)

 I dug up an old post on the list because I remembered someone saying 
 that I could get the output from the Mac OSX Console.app's 
 console.log. But the info does not appear in the log.

 Anyone solve this mystery already?

 Frieda


 ///


 Frieda Reichsman, PhD

 Molecules in Motion

 Interactive Molecular Structures

 http://www.moleculesinmotion.com


 ///





-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] New Window with resizable applet command?

2007-03-06 Thread Angel Herraez
Bob Hanson wrote:

[snip]
 OK, I have that now in 
 http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/new.htm


Amazing and delightful!

Works fine in WinXP:
Firefox 1.5
Opera 9.0
Netscape 7.0
Mozilla 1.7.12
but
IE 7 and 5.5:  new window is empty -no applet- 

As for the source of trouble, I try to guess:
1) Some Microsoft security -protect you from yourself? ;-)
2) Bob, I had a look at Jmol.js, and think that in 
_jmolGetAppletSize()
you are adding px even if size is in percent?

IE says runtime error - object was expected (cannot find in which 
point, since all is in one line and MS Script Editor doesn't give 
more clues -or I don't know how to)

Firefox javascript console -although it basically works- says:
Error:  an end of value was expected for the property, but 'px' was 
found.  Error while reading the value for the property 'width'.  
Declaration rejected.
Source file: 
http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-
11/new.htm
Line: 0

and same for 'height'

I would say my observation above is right, and some browsers forgive 
the error while others don't.
Specifically:
http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-
11/Jmol.js
/* Jmol 11.0 script library Jmol.js (aka Jmol-11.js) 9:53 AM 3/6/2007

line 773:
function _jmolGetAppletSize(size) {

lines 781-792:
  if (typeof width == number) {
if(! (width = 25  width = 2000))
width = (width  1  width  0 ? (width * 100)+%:300)
width += px
  }
  if (typeof height == number) {
if(! (height = 25  height = 2000))
height = (height  1  height  0? (height * 100)+%:300);
height += px
  }

I think they should be:
  if (typeof width == number) {
if(width = 25  width = 2000)
width += px
else
width = (width  1  width  0 ? (width * 100)+%:300px)
}
  if (typeof height == number) {
if(height = 25  height = 2000)
width += px
else
height = (height  1  height  0? (height * 100)+%:300px);
}


Right?



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Mac: copying from script window of Jmol application?

2007-03-06 Thread Frieda Reichsman


On Mar 6, 2007, at 12:31 PM, Bob Hanson wrote:

Anyway, with the WRITE command, you shouldn't have to fool with any  
of this. But I see that I haven't fully realized the CLIPBOARD  
functionality of that command. Right now we only have:


write image clipboard

(Does that work for you, frieda?)


LOL! when I tried it, the word image is what gets pasted from the  
clipboard into a new document.


I will check out Jmol 11.1.18 with the new write commands...

Frieda

///

Frieda Reichsman, PhD
Molecules in Motion
Interactive Molecular Structures
http://www.moleculesinmotion.com

///


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Mac: copying from script window of Jmol application?

2007-03-06 Thread Frieda Reichsman

On Mar 6, 2007, at 12:31 PM, Bob Hanson wrote:

... OK, these are all part of Jmol 11.1.18. the code checkin system  
(SVN) is not working for me, so this is to be found at


http://www.stolaf.edu/academics/jmol/docs/examples-11/Jmol.jar


...File not found...

I believe the correct URL is:
http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/Jmol.jar

Frieda


///

Frieda Reichsman, PhD
Molecules in Motion
Interactive Molecular Structures
http://www.moleculesinmotion.com

///


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Mac: copying from script window of Jmol application?

2007-03-06 Thread Frieda Reichsman


On Mar 6, 2007, at 12:31 PM, Bob Hanson wrote:

It should appear in the log (along with all sorts of other stuff)  
if you use


set loglevel 5


After setting loglevel to 5, then saying 'show script' there is  
nothing in Java console.log, as accessed through Console.app.


But there are other possible solutions to try at this point...

Frieda

///

Frieda Reichsman, PhD
Molecules in Motion
Interactive Molecular Structures
http://www.moleculesinmotion.com

///


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Mac: copying from script window of Jmol application?

2007-03-06 Thread Frieda Reichsman

OK, in Jmol 11.1.18,

write state myfile.spt
and
write state clipboard

both work to produce a script that reproduces the state. Hurrah!

The only parameter I find that is not faithfully reproduced (so far)  
is background color of the applet. Is this intentional, since it  
might be specified in the code that creates the applet?


Frieda


On Mar 6, 2007, at 12:32 PM, Bob Hanson wrote:


I guess we can have

write isosurface clipboard
write mo clipboard
write state clipboard
write var x clipboard

etc.

... OK, these are all part of Jmol 11.1.18.


///

Frieda Reichsman, PhD
Molecules in Motion
Interactive Molecular Structures
http://www.moleculesinmotion.com

///


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


[Jmol-users] Is there a simple way to create an ellipse?

2007-03-06 Thread Dean Johnston
Jmol users,

  I¹d like to create a representation of a plane that is an ellipse rather
than a rectangle.  Is there a simple way to create a representation of an
ellipse in Jmol?  Thanks for any pointers / suggestions.

Dean Johnston
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] .dx files available

2007-03-06 Thread Bob Hanson
Michael, thank you very much for the DX files. That was just what I 
needed. Frieda, by the time you read this I will have uploaded a new 
11.1.18 version of Jmol that reads these DX files in the form:

ISOSURFACE sasurface map 1dry.dx

Then from the application

write isosurface 1dry.jvxl

saves the Jvxl file. To read that back in, just:

load 1dry.pdb
isosurface 1dry.jvxl

That does it.

Jmol can now map this APBS data onto any molecular surface. I'm happy to 
report that the resultant JVXL surface WITH the mapped colors comes in 
at 64K (this for 1dry.pdb). That's the expected 300:1 compression, 
considering that only 2/3 of the JVXL file is color data (40K). 
Basically that means we see a compression from 12900 KB to 40 KB. I can 
live with that!

Michael, if you don't have a clue what I'm talking about, check out

http://www.stolaf.edu/academics/chemapps/jmol/docs/misc/JVXL-format.pdf

Basically what I have created is a very compact file format that Jmol 
can read and write (in command-line batch mode if desired, by the way). 
These Jmol Voxel files incorporate ONE full surface or planar slice 
with color mapping. The savings is due to the fact that we can't 
arbitrarily map the resultant data onto any data set. The mapping is 
done -- this is now effectively a 2-D selection from the 3D data -- 2D 
in the sense that all surfaces, no matter how curved, are still two 
dimensional, not three. So we see this incredible compression.

Frieda, I'm compiling now, and Nico will be updating the SourceForge 
site sometime Wednesday, I expect.

Bob Hanson





Michael Lerner wrote:

 Hi,

 I'm uploading things right now.  I compressed the rest of the files so 
 that they would transfer more quickly.  They should be done soon, but 
 some of the .dx and .wrl files are large.

 Let me know if you need anything else,

 -Michael



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


[Jmol-users] [Fwd: Re: New Window with resizable applet command?]

2007-03-06 Thread Bob Hanson
OK, this is good news.

The basic story is that if you want your applet to resize automatically, 
just use the latest Jmol.js and instead of 300 or 400 for a size, 
use 0.6 or 0.95. This tells Jmol to use percent instead of pixels 
for the size in the object tag. That does the trick.

If you have special need for other sorts of resizing -- a how about a 
bigger applet? button for example -- then tie that button to

jmolResize(w,h)  where w and h are the width and height you want.


Bob


 Original Message 
Subject:Re: New Window with resizable applet command?
Date:   Tue, 6 Mar 2007 19:36:40 +
From:   Nick Greeves [EMAIL PROTECTED]
To: Bob Hanson [EMAIL PROTECTED]
References: 
[EMAIL PROTECTED] 
[EMAIL PROTECTED] 
[EMAIL PROTECTED]



Hi Bob,
Works nicely on Mac OS X Safari and Firefox.
I know you only wanted to here about failures but this looks great!

All the best

Nick

-- 

WWW Pages: http://www.liv.ac.uk/Chemistrywww/Staff/greeves.html

Tel: +44 (0)151-794-3506 (3500 secretary)



On 6 Mar 2007, at 16:48, Bob Hanson wrote:

 OK, how about this in Jmol.js:

 jmolResize(w,h)

 w or h = 1 implies a percent; h missing defaults to w:

 jmolResize(500,500)
 jmolResize(400)
 jmolResize(0.95,0.60)
 jmolResize(0.95)

 Ah, and here is the nicest part: I've modified Jmol.js to allow for 
 percentages as well in the jmolApplet command itself:


 jmolApplet(95%)

 or

 jmolApplet(0.95)

 Then the applet automatically resizes, far as I can tell -- tested in 
 Firefox, Opera, and IE on a PC. Looks like the browsers properly send 
 the information to the applet indicating resizes if the applet 
 width/height are given as percentages.

 In playing with this, I notice that if the applet is in a DIV, then 
 that percent applies only to that div.

 What's interesting is that with the capability of saving and restoring 
 the state now, we really could do just this -- have a button (on the 
 webpage, I think) that captures the state of the applet, designs a new 
 window with the appropriate resize functions, and inserts applet code 
 into the new window such that the state script is run.

 OK, I have that now in 
 http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/new.htm

 Just click on new applet window under the applet.

 Let me know if this does not work.

 Bob


 Nick Greeves wrote:

 I agree this works well and made me think about how it could be used 
 more widely.

 In ordinary web pages I often use the Open Link in New Window(Frame) 
 feature of my browser (Safari) to create a new window of the content 
 I want to scrutinise  in more detail without losing the initial page. 
 Or when you click on thumbnail image to see the full size picture

 So how about a command for Jmol (and in the menu) that creates a New 
 Window with a resizable Jmol frame. That way we can keep small 
 windows as embedded items in web pages but have the capability to 
 blow them up if required.

 All the best

 Nick

 -- 

 WWW Pages: http://www.liv.ac.uk/Chemistrywww/Staff/greeves.html

 Tel: +44 (0)151-794-3506 (3500 secretary)



 On 6 Mar 2007, at 13:28, [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 From: Frieda Reichsman [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED]

 Subject: Re: [Jmol-users] resize applet with window (was:

 Mol-graphics: Jmol  VB ?)

 To: jmol-users@lists.sourceforge.net 
 mailto:jmol-users@lists.sourceforge.net

 Cc: Bob Hanson [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]

 Message-ID: [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED]

 Content-Type: text/plain; charset=us-ascii


 I changed the subject line to make this a bit easier to find in  
 future, if someone is looking on the archives - and wow, it works  
 beautifully-- what a great enhansonment!  ;^)





-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] New Window with resizable applet command?

2007-03-06 Thread Bob Hanson
Angel Herraez wrote:

Bob Hanson wrote:

[snip]
  

OK, I have that now in 
http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/new.htm




Amazing and delightful!

Works fine in WinXP:
   Firefox 1.5
   Opera 9.0
   Netscape 7.0
   Mozilla 1.7.12
but
   IE 7 and 5.5:  new window is empty -no applet- 

As for the source of trouble, I try to guess:
1) Some Microsoft security -protect you from yourself? ;-)
2) Bob, I had a look at Jmol.js, and think that in 
   _jmolGetAppletSize()
you are adding px even if size is in percent?

  

function _jmolGetAppletSize(size) {
...
oops!

right! I got mixed up in all the negatives. This is better:

function _jmolGetAppletSize(size) {
  var width, height;
  var type = typeof size;
  if (type == object  size != null) {
width = size[0]; height = size[1];
  } else {
width = height = size;
  }
  if (typeof width == number) {
width = (width = 25  width = 2000 ? width + px
 : width  1  width  0 ? (width * 100)+%:300px)
  }
  if (typeof height == number) {
height = (height = 25  height = 2000 ? height + px
 : height  1  height  0 ? (height * 100)+%:300px)
  }
  return [width, height];
}

Don't you love the way you can completely mess with variable types in 
JavaScript!!!



IE says runtime error - object was expected (cannot find in which 
point, since all is in one line and MS Script Editor doesn't give 
more clues -or I don't know how to)

  


Hmm. I had trouble with MSIE 5.whatever but it went away when I took out 
the body onresize... business.


Firefox javascript console -although it basically works- says:
Error:  an end of value was expected for the property, but 'px' was 
found.  Error while reading the value for the property 'width'.  
Declaration rejected.
Source file: 
http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-
11/new.htm
Line: 0

and same for 'height'

Right?

  

right. But I doubt that's the problem with MSIE 7. Would be nice if it 
were only that.



-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users