Bob Hanson wrote:
>We did it! With Nico's tips and a some challenging debugging, I do
>believe we have a version of Jmol that can be run with no graphics
>window, delivering text over sysout and graphics to files or the
>clipboard. "-n" now really means NO display. I have some clean up to do,
>but if you want to try it out, here's a general formula:
>
> Jmol -ionx myscript.spt -w CLIP mymodel.cif
>
>to load mymodel.cif, run the script in myscript.spt, copy the image to
>the Windows (mac?) clipboard, and exit.
>
>This says (i) silent (o) output to sysout (n) no display frame (x) run
>indicated script and exit (w) write -- to the Windows clipboard in this
>case.
>
> Jmol -ionx myscript.spt -w JPEG:myimage.jpg mymodel.cif
>
>to do the same, but to write a JPEG to myimage.jpg mymodel.cif
>
> Jmol -ionx myscript.spt -w JPEG:myimage.jpg mymodel.cif > myoutput.txt
>
>to do the same, but now to also trap the output from SHOW or getProperty
>script commands in myoutput.txt
>
>Please let me know if this works. I'm transferring a temporary version
>of just the application file at
>
> http://www.stolaf.edu/academics/chemapps/jmol/Jmol.jar
>
>in case anyone wants to test this out right away.
>
>
>
Image creation works with linux (SuSE 9.3, java 1.4.2_11) without
showing a window. But Jmol still needs a valid connection to an
X-server. If I connect to the server with 'ssh' without tunneling the
X-server connection (no '-X' option) I get the following error message:
uncaught exception: java.lang.InternalError: Can't connect to X11 window
server using ':0.0' as the value of the DISPLAY variable.
java.lang.InternalError: Can't connect to X11 window server using ':0.0'
as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at
sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:134)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
at java.awt.Window.init(Window.java:231)
at java.awt.Window.<init>(Window.java:275)
at java.awt.Frame.<init>(Frame.java:401)
at java.awt.Frame.<init>(Frame.java:366)
at javax.swing.JFrame.<init>(JFrame.java:154)
at org.openscience.jmol.app.Jmol.main(Jmol.java:514)
command used: java -jar Jmol-10.9.67a.jar -g 600x600 -ionx 1D66.jmz -w
PNG:1D66.png
With IRIX64 on an SGI computer (java 1.4.1_06) it doesn't work with the
same command (connected with 'ssh -X'). I get the following error message:
java.lang.IllegalArgumentException: Width (0) and height (16) cannot be <= 0
at
java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:250)
at org.jmol.g3d.Swing3D.allocateOffscreenImage(Swing3D.java:78)
at org.jmol.g3d.Platform3D.checkOffscreenSize(Platform3D.java:171)
at org.jmol.g3d.Text3D.<init>(Text3D.java:72)
at org.jmol.g3d.Text3D.getText3D(Text3D.java:193)
at org.jmol.g3d.Text3D.plot(Text3D.java:202)
at org.jmol.g3d.Graphics3D.drawStringNoSlab(Graphics3D.java:481)
at org.jmol.g3d.Graphics3D.drawString(Graphics3D.java:456)
at org.jmol.viewer.Text.renderSimple(Text.java:404)
at org.jmol.viewer.LabelsRenderer.render(LabelsRenderer.java:101)
at org.jmol.viewer.ShapeRenderer.render(ShapeRenderer.java:60)
at org.jmol.viewer.FrameRenderer.render(FrameRenderer.java:62)
at org.jmol.viewer.RepaintManager.render(RepaintManager.java:155)
at org.jmol.viewer.Viewer.getImage(Viewer.java:2009)
at org.jmol.viewer.Viewer.getScreenImage(Viewer.java:2068)
at org.openscience.jmol.app.ImageCreator.createImage(Jmol.java:1563)
at
org.openscience.jmol.app.Jmol$MyStatusListener.createImage(Jmol.java:1426)
at org.jmol.viewer.StatusManager.createImage(StatusManager.java:348)
at org.jmol.viewer.Viewer.createImage(Viewer.java:3632)
at org.jmol.viewer.Viewer.createImage(Viewer.java:3628)
at org.jmol.viewer.Viewer.evalStringWaitStatus(Viewer.java:2174)
at org.jmol.viewer.ScriptManager.runScript(ScriptManager.java:130)
at
org.jmol.viewer.ScriptManager.runNextScript(ScriptManager.java:119)
at
org.jmol.viewer.ScriptManager$ScriptQueueRunnable.run(ScriptManager.java:146)
at java.lang.Thread.run(Thread.java:536)
I noticed that the image created by the application per command-line
looked different than that created by the applet using the same script.
The script contains a 'move 180 0 0 0 0 0 0 0 3;' command at the end to
provide the user with a first look around the model. At first I thought
that this command was ignored, because this was exactly the difference,
a rotation of 180 degrees around the X-axis. But when I started the
application without the 'nodisplay' option the rotation was done at the end.
So it looks as if the initial view is rotated 180 degrees around the
X-axis between the applet and the application.
I would guess that this is not intentional and it would be nice if the
application and the applet would produce the same view using the same
script on the same structure file.
Regards,
Rolf
-------------------------------------------------------------------------
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.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers