Disclaimer: the code examples in this repository require the CDK-JChemPaint patch, and not the JChemPaint 3.0 applet code. The required jars are provided in this repository.
This is the repository matching the scripts listed in the following blog posts:
- CDK-JChemPaint #1: rendering molecules
- CDK-JChemPaint #2: rendering reactions
- CDK-JChemPaint #3: rendering parameters
- CDK-JChemPaint #4: embedding the renderer into a Swing panel
- CDK-JChemPaint #6: rendering atom numbers
- CDK-JChemPaint #7: rendering molecules as SVG
- CDK-JChemPaint #8: rendering of aromatic rings
- CDK-JChemPaint #9: implicit hydrogens and isotopes
- CDK-JChemPaint #10: background color
- CDK-JChemPaint #11: coloring selections
The below commands require you have a checkout of this repository. You can clone it from the command line with something in the line of:
$ git clone git://github.com/egonw/groovy-jcp.git
$ cd groovy-jcp
I am not sure how this works on OS/X or Windows (please let me know!), but you can run the scripts provided here on GNU/Linux systems with the following commands.
For the following scripts, you can use a stock CDK release:
$ export CLASSPATH=cdk-1.5.4.jar
$ groovy script.groovy
Where script.groovy is one of:
- renderMol.groovy
- dumpParameters.groovy
- renderRS.groovy
- swing.groovy
- greyBG.groovy
- renderAromaticity.groovy
- renderAtomNumbers.groovy
- renderImplicitHydrogens.groovy
- renderIsotopes.groovy
For the editor interaction, selection highlighting, reaction rendering, and SVG output you need to rest of the CDK-JChemPaint patch:
$ export CLASSPATH=cdk-1.5.4.jar:cdk-jchempaint-31.jar
$ groovy script.groovy
where script.groovy is one of the remaining scripts provided in this repository:
- svgMol.groovy
- renderReaction.groovy
- renderSelection.groovy