Difference between revisions of "Jmol JavaScript Object/JME"

From Jmol
Jump to navigation Jump to search
(Info variable for JME)
(JME-specific methods)
Line 32: Line 32:
  
 
Syntax:
 
Syntax:
  Jmol.jmeGetFile = function(jme, asJME)  
+
  Jmol.jmeGetFile(myJME, asJME)  
  Jmol.jmeOptions = function(jme, options)
+
  Jmol.jmeOptions(myJME, options)
  Jmol.jmeReadMolecule = function(jme, jmeOrMolData)
+
  Jmol.jmeReadMolecule(myJME, jmeOrMolData)
  Jmol.jmeReset = function(jme)  
+
  Jmol.jmeReset(myJME)  
  Jmol.jmeSmiles = function(jme, withStereoChemistry)
+
  Jmol.jmeSmiles(myJME, withStereoChemistry)

Revision as of 19:19, 26 February 2013

Integration of JME into Jmol-JSO

The JME applet (Java Molecular Editor by Peter Ertl) allows the user to draw a molecular structure in 2D. Jmol-JSO includes the capability to pass information back and forth between JME and Jmol in a seamless manner. The "information panel" that Jmol-JSO implements can be set up to hold the JME applet, allowing tight integration. Alternatively, the JME applet and the Jmol applet can be set side-by-side on a web page, and applet-applet communication can be handled by the page developer.

Creating and inserting the JME applet

To create a JME applet, use Jmol.getJMEApplet().

Syntax:

Jmol.getJMEApplet = function(id, Info, linkedJmolApplet)

linkedJmolApplet can be set to a Jmol JavaScript Object that will contain this JME drawing panel as a 2D input option in its info panel.

Parameters making the Info variable (with default values shown between angular brackets):

  • height <300>
  • width <300>
  • jarPath <.>
  • jarFile <JME.jar>
  • options <autoez>
    • rbutton, norbutton - show / hide R button
    • hydrogens, nohydrogens - display / hide hydrogens
    • query, noquery - enable / disable query features
    • autoez, noautoez - automatic generation of SMILES with E,Z stereochemistry
    • nocanonize - SMILES canonicalization and detection of aromaticity supressed
    • nostereo - stereochemistry not considered when creating SMILES
    • reaction, noreaction - enable / disable reaction input
    • multipart - possibility to enter multipart structures
    • number - possibility to number (mark) atoms
    • depict - the applet will appear without editing butons,this is used for structure display only
    • Documented at [1]

JME-specific methods

All these functions must be applied to the unique Jmol object (this name is literal, cannot be changed) --see syntax and examples below.

Syntax:

Jmol.jmeGetFile(myJME, asJME) 
Jmol.jmeOptions(myJME, options)
Jmol.jmeReadMolecule(myJME, jmeOrMolData)
Jmol.jmeReset(myJME) 
Jmol.jmeSmiles(myJME, withStereoChemistry)

Contributors

AngelHerraez