Skip to content
rwst edited this page May 22, 2012 · 3 revisions

JCP contains a number of templates, which can be pasted from the Templates menu. Here is how these are organized:

  • JCP src contains a package org.openscience.jchempaint.dialog.templates (this directory is marked up by containing the DummyClass, which is an empty class), which contains a number of sub packages. Every subpackage automatically becomes a tab in the templates dialog. So in order to add a tab add a sub package.
  • Every mol file in a sub package automatically becomes an entry on the respective tab. The first line of the mol file becomes the title of the entry.
  • The entry gets an icon, if there is a file called *.png in the same directory as the mol. You should not add manually created pngs there, but in order to keep uniform entries you should use the ant task processTemplates. This will for each mol entry create a png image in src, which you can then commit.
  • The entries in the Template menu are not generated automatically. So if you want your tab to show up there, you need to do it manually (see JCP GUI configuration). If you do a menu entry, its key must be exactly the name of a sub package in templates, else no tab will be opened.