Customizing Marvin GUI
The Customization document demonstrates an easy, interactive way of GUI personalization.
This document shows how to use the same interactive method to customize the GUI if MarvinSketch is used as an applet being on a server or as a JavaBean.
API XSD
Note, that API and XSD will also be available very soon.
Configuration file
MarvinSketch stores all changes made on the GUI in a configuration file.
This file is located at
USER_HOME/CHEMAXON_DIR/VERSION/customization.xml
where
-
USER_HOME is
C:\Documents and Settings\USERNAME
on Windows,
/home/USERNAME
on Unix
-
CHEMAXON_DIR is
chemaxon
(Windows)
or.chemaxon
(Unix)
-
VERSION is the actual version number of MarvinSketch, with which the customization is made
Example location:
Windows:
C:\Documents and Settings\USERNAME\chemaxon\
6.4
.
0
\customization.xml
Unix/Linux:
/home/USERNAME/.chemaxon/
6.4
.
0
/customization.xml
Applet customization step-by-step
-
Remove the the configuration file from your local file system (make sure to create a backup)
-
Launch MarvinSketch on the client side
-
Personalize the GUI using the methods described in the Customization document
-
Upload the newly created configuration file to be beside the MarvinSketch applet on the server, e.g.,
http:
//example-server.org/marvin/customization.xml
-
Set the "menuconfig" applet parameter to the URL of the configuration file, e.g.,
msketch_param(
"menuconfig"
,
"http://example-server.org/marvin/configuration.xml"
);
or
msketch_param(
"menuconfig"
,
"files/marvin/configuration.xml"
);
JavaBean customization step-by-step
-
Remove the the configuration file from your local file system (make sure to create a backup)
-
Launch MarvinSketch on the client side
-
Personalize the GUI using the methods described in the Customization document
-
Copy the newly created configuration file to a path which is included in the classpath of the application
-
Use UserSettings to instantiate the bean:
UserSettings userSettings=
new
UserSettings();
userSettings.put(
"menuconfig"
,
"org/example/configuration.xml"
);
MSketchPane sketchPane=
new
MSketchPane(userSettings);
Example 1: Make ISIS/Draw-like configuration to be the default
The Configurations document describes built-in alternative schemas for personalized GUIs.
To make a configuration schema to be the default, the identifier of the desired configuration has to be set in a simple xml file.
The identifiers of the available configurations are below:
Configuration |
Identifier |
Marvin |
default |
Classic Marvin |
classic |
ISIS/Draw-like |
config1 |
ChemDraw-like |
config2 |
The contents of the configuration file:
<?xml version=
"1.0"
encoding=
"UTF-8"
?>
<customization active=
"config1"
>
</customization>