By default, MarvinSketch contains 12 template groups, as described in the Developer's Guide. The Generic and My Templates groups automatically appear on the Advanced Templates toolbar for easier access.
In this example, the My Templates group contains one molecule: benzene.
The goal of this example is to customize the template structures of MarvinSketch in the following way:
The result of this customization can be seen in the picture below. The Conformers and My Templates template groups are not visible on the toolbar in this case.
The code below is taken from
SketchTemplates.java, where the structure templates are customized using the
setParams method of the
MSketchPane class. Currently, this is the only way of defining template groups.
In the example, the characters
: are used as delimiters.
sketchPane. setParams ( UserSettings.TOOLBAR_TEMPLATES+ "0=*Generic*chemaxon/marvin/templates/generic.t \n " + UserSettings.TOOLBAR_TEMPLATES+ "1=*Rings*chemaxon/marvin/templates/rings.t \n " + UserSettings.EXTRA_TEMPLATES+ "=chemaxon/marvin/templates/wedgebonds.t \n " + UserSettings.TEMPLATES+ "11=:Conformers:chemaxon/marvin/templates/conformers.t \n " );
The new template group called Conformers is defined with the [tmpls](display-parameters.md parameter, which makes it available in the Template Library.