Applet only parameters

The following parameters are meaningful only for the applet (JMSketch) and not for the JavaBean (MSketchPane).

Parameter

Meaning

Default

menubar

Enable the embedded menubar.

true

buttonmenubar

Enable menubar in button (/hide) mode if the menubar parameter is true. Combine it with the detach parameter to set the button mode.
True, to allow, false to deny menu bar on the big sketcher button.

true

detach

Detachment behavior. The value consists of some optional arguments: show/hide size, and maxscale. If more arguments are included, they must be separated by a comma.
To detach the sketcher from the web page and display it in a separate window, set "show".
To detach the sketcher without displaying the separate window, set "hide".
Both settings make the applet on the web page look like a molecule viewer.

The initial size of the sketcher window can be specified with "size=widthxheight"
Examples: "show", "size=500x500", "hide,size=500x500".
In case the maxscale argument is set, it can prevent small molecules to be overscaled on the button.
Example for maximum 100% magnification: "hide,maxscale=28"
Live applet example: MarvinSketch Exemple - Pure visualization mode

size=444x350

undetachByX

Sketcher window close (x) behavior.
false: always hide sketcher
true: replace viewer component by sketcher in web browser window if the applet is large enough (>= 400x300)

true

mol

The molecule file to be loaded at startup, as either a URL or the file itself (inline) in MDL mol, compressed mol, SMILES, SMARTS, etc format.
Newlines occurring in the string must be replaced or preceded by "\n" and backslashes are recommended to be escaped as "\\".
The file format and/or import options can be specified if one of the following forms is used:
"file{options}",
"file{MULTISET,options}",
"file{format:}",
"file{format:options}", or
"file{format:MULTISET,options}".
If the MULTISET option is specified, then a multi-molecule file is read into one molecule object containing multiple atom sets.
Examples: "foo.xyz{f1.4C4}", "foo.xyz.gz{gzip:xyz:MULTISET,f1.4C4}"

 

preload

Deprecated

 

cacheMols

Store loaded molecules in an internal cache (true or false).

false

loadMols

Comma-separated list of molfiles to preload. Useful for caching molecules in JavaScript "slideshows".

 

usedJars

Comma-separated list of additional jar files that can be used by the applet. The additional files have to be defined with their paths relative to the applet's base.

 

imageSaveFormat

The default file format for image saving.

png

molLoaderFinishedEvent

Evaluates a JavaScript code after the loading of the molecule into the editor is finished. This "event" is invoked if molecule is loaded-in into the applet in any of the following cases:

  • Automaticaly, at applet starting: (using the mol applet parameter)

  • Calling (J)MSketch.setMol(...) from JavaScript.

Note: If the MAYSCRIPT option is not specified, JavaScript can not be evaluated from the applet. E.g.:

msketch_mayscript=true;
msketch_begin("marvin",400,300);
msketch_param("mol","caffeine.mol");
msketch_param("molLoaderFinishedEvent","js:alert('Molecule is loaded-in.')");
msketch_end();
     

 

listenpropertychange

Switch on/off property change event listener to the applet. If listener is active, the applet will call propertyChange(prop) JavaScript method. If you would like to handle property change events in JavaScript, implement this method in your html source. Note: If the MAYSCRIPT option is not specified, JavaScript can not be evaluated from the applet. E.g.:

function propertyChange(prop) {
if(document.textform != null) {
var s = document.textform.txt.value;
document.textform.txt.value = s + "\n" + prop;
}
}
 
msketch_mayscript=true;
msketch_begin("marvin",400,300);
msketch_param("listenpropertychange","true");
msketch_end();
     

If you also specify the "appletid" parameter, its value will appear in the name of the property as prefix (e.g.: "firstapplet.mol").

false

appletid

Identify applet in property change event notifications to JavaScript. Use this parameter with listenpropertychange when more than one applet are located on the same web page. It helps to identify which applet sent the notification.

 

skin

Change the component's Look & Feel (only in SWING applet). If you do not specify this parameter, Marvin will use the default LookAndFeel style.
This parameter value is the name of the new LookAndFeel class.

javax.swing.plaf .metal .MetalLookAndFeel

splashScreenImage

Change the component's splash screen displayed at startup. If you do not specify this parameter, Marvin will use its default splash screen.
This parameter value is the relative path of the image, specify relatively to the CODEBASE
Note: Animated gif files can be displayed badly (flashing, or too fast animation)

null

license

Sets the contents of a pre-read license file to the license manager to read and validate licenses from.

 

licenseFile

Sets the license file location to the license manager to read and validate licenses from.

 

onError

A string containing a javascript code, that has to be run by the applet, if it has a failure at initialization.
The %s wildcard can be used to include the error message given by the applet inside the javascript code.
If used with alertError also set to true, the alert window will be shown first, and after the user has pressed the OK button on the alert will the given code run.

 

alertError

If this parameter is set to true, the applet will show a javascript alert window with an error message, if there was a problem in the initialization process of the applet.

 

legacy_lifecycle

The "legacy_lifecycle" is a general Java applet parameter. If its value is true, it helps avoid destroying the applet when you leaves the applet page. If you use "marvin.js", it sets its value to true automatically unless you specify its value explicitly. By the way, the default value of this parameter in Java is false. See the discussion about it on the forum.

 

bgloadPriority

You can specify the order of the modules for background loading. After startup of MarvinSketch, modules that are not used yet are started downloading in the background to fast up their initalization of their first usage. The value of this parameter is a comma separated list of modules that get priority for loading. See also bgloadEnabled.

 

bgloadEnabled

Let or deny loading of rest of modules in a background thread after startup. Set this parameter to true to accept background loading. Set it to false if you would like to reject this functionality.

true

sketchHelp

MarvinSketch help contents. Accepts relative URL to the applet codebase or any absolute URL.

chemaxon/marvin/help /sketch-index.html

sketchQuickHelp

MarvinSketch quick help. Accepts relative URL to the applet codebase or any absolute URL.

chemaxon/marvin/help /sketch.html

checkerConfigURL

Default checker configuration URL. Accepts any absolute URL.

local configuration