configuring preferences

User 870ab5b546

11-08-2016 19:50:28

I see that I can set a preference not to show plus signs when I draw a reaction. Can I set this preference inside a configuration.xml document? If so, how? I don't see anything in your documentation about how to do it. I would also like to set the preference for the 3D minimization method. 

ChemAxon 775b29fd6e

17-08-2016 14:13:13

Hi Bob,


If I understood you correctly this might help. I've put a comment section for each line which represents a radio button on our UI. You can find the possible parameters here.


final JFrame frame = new JFrame();

final UserSettings userSettings = new UserSettings("test-settings");
userSettings.setAutomaticReactionEnabled(false);

userSettings.setClean3dOpts(""); // Fine build
userSettings.setClean3dOpts("S{fine}[prehydrogenize]"); // Fine with hidrogenize
userSettings.setClean3dOpts("S{fast}"); // Fast build
userSettings.setClean3dOpts("c31o1S{fine}"); // Build or optimize
userSettings.setClean3dOpts("c2o1"); // Gradient optimize

userSettings.save("test-settings saved");

final MSketchPane msketchPane = new MSketchPane(userSettings);
msketchPane.getMolPanel();

frame.setSize(500, 400);
frame.add(msketchPane);
frame.setVisible(true);


Regards, Zoltan.

User 870ab5b546

17-08-2016 16:24:52

Maybe I didn't make myself clear. I am looking for a way to set the preferences of a MarvinSketch applet instance that has been loaded into a browser. Marvin provides two ways to set how to control the appearance and available features of the applet.


1. Javascript methods msketch_param() that set various parameters such as scale, lonePairsVisible, etc. The code looks something like this:


    msketch_name = appletName;
msketch_begin('/nosession/' + marvinVersion, panelWidth, panelHeight);
msketch_param('menuconfig', configFileBld.toString());
msketch_param('molbg', '#ffffff');
msketch_param('scale', 25); // C-C bond length in pixels; also increases font size
msketch_param('circledChargeSize', 0.6); // deprecated by 1/1/2016
msketch_param('implicitH', hydrogensVisible);
msketch_param('sketchCarbonVisibility', getCVisibility(qFlags));
msketch_param('lonePairsVisible', getLonePairsVisible(qFlags));
msketch_mayscript = true;
msketch_end();

2. A configuration file that sets which toolbar and menu options are available and which is also loaded with msketch_param(). A configuration file looks something like this:


<?xml version="1.0" encoding="UTF-8"?>
<customization active="classic">
<scheme id="classic" largeIcons="true">
<remove path="toolbar/chemical"/>
<remove path="toolbar/config3_1"/>
<remove path="toolbar/config3_2"/>
<remove path="toolbar/config3_3"/>
<remove path="toolbar/config3_4"/>
<toolbar id="CustomToolbar-0" anchor="north" row="1" index="0">
<item id="selectModeGroup"/>
<item id="rotate3DFree"/>
<item id="rotate3DGroup"/>
<item id="eraseMode"/>
<item id="cut"/>
<item id="copy"/>
<item id="paste"/>
</toolbar>
<remove path="popup/bond/bond-sep-2"/>
<remove path="popup/bond/bond-type-menu/sep-1"/>
<remove path="popup/bond/bond-type-menu/bondType.cisOrTrans"/>
<remove path="popup/bond/bond-type-menu/bondType.cisOrTransOrUnspec"/>
<remove path="popup/bond/bond-type-menu/sep-2"/>
<remove path="popup/bond/bond-type-menu/bondType.singleOrDouble"/>
<remove path="popup/bond/bond-type-menu/bondType.singleOrAromatic"/>
<remove path="popup/bond/bond-type-menu/bondType.doubleOrAromatic"/>
<remove path="popup/bond/bond-type-menu/bondType.any"/>
<remove path="popup/bond/bond-type-menu/sep-3"/>
<remove path="popup/bond/bond-type-menu/bondType.coord"/>
<add path="menubar/view-menu/transform-menu">
<item id="rotate3DFree"/>
<item id="rotate3DGroup"/>
</add>
</scheme>
</customization>

My question is, is there either an msketch_param() parameter or a configuration file XML tag provided to set what preferences the applet is loaded with? I want to turn off the display of the + sign when the user draws a single reaction arrow. I see that there is msketch_param('valenceErrorVisible', value) to control whether valence errors are visible, and this flag can also be set in the Edit -> Preferences panel; I'm asking if there's a similar way to set other preferences.


I appreciate the code you provided above, but I don't know where to put it. 

ChemAxon 775b29fd6e

18-08-2016 12:11:15

Hi Bob,


well I'm afraid that's not possible. The available parameters are here.


Regards, Zoltan.

User 870ab5b546

18-08-2016 13:03:48

Could you please create msketch_param() and mview_param() parameters that allow the developer to turn off the MarvinSketch/View applets' display of the + sign in reactions?

ChemAxon 7936325a45

04-10-2016 12:35:59

Hi Bob,

I'm not sure about introducing new applet parameters, we need to discuss this. We wouldn't like to make any development in the applet codebase. We are releasing the applet on demand and it is going to be discontinued int the near future.

Here's an infographics about the causes: https://www.chemaxon.com/blog/java-applet-technology-the-past-and-future-and-the-end/ />
Cheers,
István 

User 870ab5b546

04-10-2016 15:10:45

OK, I understand. I will stop asking for MarvinSketch applet improvements. But the desktop version of MarvinSketch will continue to be developed and supported, correct?

ChemAxon 7936325a45

04-10-2016 15:30:13

Of course, the desktop version will continue to be developed, improved, and supported.

By the way in the desktop version you can set the reaction calculation preferences in the marvin.properties file by setting automaticReactionEnabled to true or false.