MarvinSpace
The traditional way to put the MarvinSpace applet to a web page is by writing the following text in the HTML:<applet codebase="../../.." code="chemaxon/marvin/applet/MSpaceApplet" name="MSpaceApplet" width=400 height=400 archive="mspace.jar,jmarvin.jar,jogl.jar"> <param name="progressbar" value="true"> <param name="selectionpanel" value="false"> <param name="molecule" value="http://www.chemaxon.com/marvinspace/data/1ETS.mol"> </applet>Let's go through the special elements:To correctly work with Sun's Java Plugin, marvin.js provides platform dependent solutions. Apart from the standard
- The
CODEBASEoption specifies the directory of the Marvin binaries relative to the HTML file. This HTML file is in a subdirectory of the Marvin binaries directory, that's why we use "../../.." here.- The
ARCHIVEoption is needed to speed up the downloads. The program code is packaged into compressed JAR files,jmarvin.jar,mspace.jarandjogl.jar.- To indicate the loading the applet
progressbarcan be used.- The applet parameter
selectionpanelis used to embed a simple MarvinSpace applet without special GUI elements. However they can also be displayed, this will be discussed in another example.- The
moleculeapplet parameter is an easy way to load molecule(s) by giving a location of the input or a SMILES string.<applet>tag, it uses<embed>for Firefox (mozilla) and<object>for Microsoft Internet Explorer. The applet can be embedded in HTML pages using marvin.js the following way:<script type="text/javascript" SRC="../../../marvin.js"></script> <script type="text/javascript"> <!-- mspace_name="MSpaceApplet"; // naming the applet to allow JavaScript calls mspace_begin(mspace_name,"../../..", 400, 400); // arguments: NAME, CODEBASE, WIDTH, HEIGHT mspace_param("progressbar","true"); mspace_param("selectionpanel","false"); mspace_param("molecule","http://www.chemaxon.com/marvinspace/data/1ETS.mol"); msspace_end(); //--> </script>
Do you have a question? Would you like to learn more? Please browse among the related topics on our support forum or search the website. If you want to suggest modifications or improvements to our documentation email our support directly!
