Difference between revisions of "Jmol Applet"
AngelHerraez (talk | contribs) (→Jmol Applet) |
AngelHerraez (talk | contribs) (new sub-section for installing notes) |
||
Line 1: | Line 1: | ||
{{Running_Jmol_Sections}} | {{Running_Jmol_Sections}} | ||
− | + | == Jmol Applet == | |
[[wikipedia:Java_applet|Java applet]] version of Jmol which allows Jmol to be embedded in web pages (given that viewers have a Java plugin installed). Like with the application, [[Scripting]] is available. For some demonstration pages see http://www.jmol.org/demo/. To see the HTML source use your web browser {{MenuItem|View}} → {{MenuItem|Page Source}}. | [[wikipedia:Java_applet|Java applet]] version of Jmol which allows Jmol to be embedded in web pages (given that viewers have a Java plugin installed). Like with the application, [[Scripting]] is available. For some demonstration pages see http://www.jmol.org/demo/. To see the HTML source use your web browser {{MenuItem|View}} → {{MenuItem|Page Source}}. | ||
− | + | == Installing Jmol Applet == | |
+ | Download Jmol package (either <code>.zip</code> or <code>tar.gz</code> format) and extract/uncompress '''only the neccessary files''' to the folder of your choice. | ||
− | + | Which are those neccessary files? For basic use, these: | |
+ | * {{File|Jmol.js}} | ||
+ | * All files whose name starts with {{File|JmolApplet0}} and ends in {{File|.jar}} | ||
+ | * If you will distribute your web page files, you should also include the copyright, license and information files: {{File|COPYRIGHT.txt}}, {{File|LICENSE.txt}} and {{File|README.txt}} | ||
+ | |||
+ | To use JmolApplet within local web pages, e.g. on the hard disk or on CD, see [[Jmol Applet Deployment Local]] for some precautions needed. | ||
+ | |||
+ | For some specific needs, you must use other files; read the sections below about the signed applet. | ||
+ | |||
+ | == Jmol in Wikis == | ||
The applet can be embedded in [[wikipedia:HTML|HTML]] (or XHTML) pages (examples are listed on [[Websites Using Jmol]]), but also, with some extra technologies, in Wiki pages (see [[Jmol Processor]]). | The applet can be embedded in [[wikipedia:HTML|HTML]] (or XHTML) pages (examples are listed on [[Websites Using Jmol]]), but also, with some extra technologies, in Wiki pages (see [[Jmol Processor]]). | ||
− | + | == Unsigned vs. Signed Applet & Data Access == | |
The '''signed''' applet can load a molecular model from any http or ftp URL. However, the user will be asked to trust the signed applet. This could be problematic since the publishing authority (jmol.org) "cannot be verified", and the security certificate was issued by a group that is "not trusted" (jmol.org). This is because it would be costly and cumbersome for each version of the applet to be signed by a trusted (commercial) authority. | The '''signed''' applet can load a molecular model from any http or ftp URL. However, the user will be asked to trust the signed applet. This could be problematic since the publishing authority (jmol.org) "cannot be verified", and the security certificate was issued by a group that is "not trusted" (jmol.org). This is because it would be costly and cumbersome for each version of the applet to be signed by a trusted (commercial) authority. | ||
Line 18: | Line 28: | ||
If you are ''not'' running the applet from any server, i.e., you are using a web page residing in a '''local disk''', further security restrictions are applied by Java: molecular models can only be located in the same folder/directory as the applet files or below it; read [[Jmol Applet Deployment Local]]. | If you are ''not'' running the applet from any server, i.e., you are using a web page residing in a '''local disk''', further security restrictions are applied by Java: molecular models can only be located in the same folder/directory as the applet files or below it; read [[Jmol Applet Deployment Local]]. | ||
− | + | == Tools for Authoring Jmol Web Pages == | |
If you are not comfortable writing html and javascript code or would just like to quickly put together some simple pages look at the program [http://www.uwosh.edu/faculty_staff/gutow/Jmol_Web_Page_Maker/Jmol_Web_Page_Maker.shtml Jmol Web Page Maker]. This is a java application that will generate simple interactive Jmol pages using a GUI interface where you can select the data files and and some basic parameters. I wrote version 1.0 of this program.--[[User:Gutow|Gutow]] 18:13, 18 July 2006 (CEST) | If you are not comfortable writing html and javascript code or would just like to quickly put together some simple pages look at the program [http://www.uwosh.edu/faculty_staff/gutow/Jmol_Web_Page_Maker/Jmol_Web_Page_Maker.shtml Jmol Web Page Maker]. This is a java application that will generate simple interactive Jmol pages using a GUI interface where you can select the data files and and some basic parameters. I wrote version 1.0 of this program.--[[User:Gutow|Gutow]] 18:13, 18 July 2006 (CEST) | ||
− | + | == Saving Files from the Applet == | |
Although this isn't obvious, the molecule that is being shown in the applet can be saved to local disk. To do so: | Although this isn't obvious, the molecule that is being shown in the applet can be saved to local disk. To do so: | ||
# Open applet's menu (right-click, Ctrl+click, or click on bottom-right "Jmol" logo). | # Open applet's menu (right-click, Ctrl+click, or click on bottom-right "Jmol" logo). |
Revision as of 14:31, 10 July 2007
- Jmol as a standalone application.
- J(S)mol as a web applet or HTML5 object.
- compatibility with JavaScript frameworks or libraries.
- J(S)mol embedded in wikis or blogs.
- Borrowed JSmol, or running JSmol without your own server.
- Running Jmol using Java Web Start.
- JSmol in a Jupyter notebook.
- Jmol in an Android tablet.
- Troubleshooting.
Contents
Jmol Applet
Java applet version of Jmol which allows Jmol to be embedded in web pages (given that viewers have a Java plugin installed). Like with the application, Scripting is available. For some demonstration pages see http://www.jmol.org/demo/. To see the HTML source use your web browser View → Page Source.
Installing Jmol Applet
Download Jmol package (either .zip
or tar.gz
format) and extract/uncompress only the neccessary files to the folder of your choice.
Which are those neccessary files? For basic use, these:
- Jmol.js
- All files whose name starts with JmolApplet0 and ends in .jar
- If you will distribute your web page files, you should also include the copyright, license and information files: COPYRIGHT.txt, LICENSE.txt and README.txt
To use JmolApplet within local web pages, e.g. on the hard disk or on CD, see Jmol Applet Deployment Local for some precautions needed.
For some specific needs, you must use other files; read the sections below about the signed applet.
Jmol in Wikis
The applet can be embedded in HTML (or XHTML) pages (examples are listed on Websites Using Jmol), but also, with some extra technologies, in Wiki pages (see Jmol Processor).
Unsigned vs. Signed Applet & Data Access
The signed applet can load a molecular model from any http or ftp URL. However, the user will be asked to trust the signed applet. This could be problematic since the publishing authority (jmol.org) "cannot be verified", and the security certificate was issued by a group that is "not trusted" (jmol.org). This is because it would be costly and cumbersome for each version of the applet to be signed by a trusted (commercial) authority.
The unsigned applet displays the molecule without asking the user to trust it. However, it is limited (for security reasons) to loading molecular models from the same http domain (server) that downloads the applet itself. FirstGlance in Jmol uses the unsigned applet by default, but the signed applet will be used when that "Advanced Option" is checked. Thus you can easily see both applets in action. Methods for accessing data files from arbitrary servers are described in some detail at PDB Data File Access Methods.
If you are not running the applet from any server, i.e., you are using a web page residing in a local disk, further security restrictions are applied by Java: molecular models can only be located in the same folder/directory as the applet files or below it; read Jmol Applet Deployment Local.
Tools for Authoring Jmol Web Pages
If you are not comfortable writing html and javascript code or would just like to quickly put together some simple pages look at the program Jmol Web Page Maker. This is a java application that will generate simple interactive Jmol pages using a GUI interface where you can select the data files and and some basic parameters. I wrote version 1.0 of this program.--Gutow 18:13, 18 July 2006 (CEST)
Saving Files from the Applet
Although this isn't obvious, the molecule that is being shown in the applet can be saved to local disk. To do so:
- Open applet's menu (right-click, Ctrl+click, or click on bottom-right "Jmol" logo).
- Click on topmost entry (name of molecule).
- On the submenu that appears, click on bottommost entry (name of file).
- Depending on your browser's configuration, the file will be opened in the associated program ("helper application") or you will get an "Open or Save" dialog; choose Save and location in your disk.
- Warning: At least in Windows, modern browsers may detect this action as opening a pop-up window, so it's likely that the pop-up blocker will prevent you from seeing the "Open or Save" dialog. Pay attention to messages and options in your browser to allow pop-ups for the current page. (Such messages often appear as yellow bars at the top of the page, warnings in a toolbar, or hints in the status line at the bottom of the browser window.)
- Note for Chime users: If you have MDL Chime installed, the molecule will be opened in a browser window using Chime. You just have to use Chime's menu (File > Save molecule as) to save the file to disk.
More user-friendly ways or saving files from JmolApplet are being considered by the developers.
In Jmol v.11, a part of the molecule can be extracted and saved into MOL format. This is not so straightforward as the former, and is described in the "interactive scripting documentation" (see Jmol home page).
The ability to save the state of the molecule (rendering style, coloring, visibility, orientation, etc.) is under development, and already partially implemented in Jmol 11.0. See save state
and write state
in the Jmol scripting documentation. This will give similar functionality to what can be done in Chime or Rasmol, although due to Java security restrictions, saving to a file is not available for JmolApplet.
Contributors
AngelHerraez, GregE, EricMartz, Hansonrstolaf, Igor, NicolasVervelle, Gutow, Ted, Pimpim, Cudo29, Green