User c23c5e9da4
16-04-2009 07:12:29
This example generates this
Exception in thread "main" java.lang.NullPointerException
at java.awt.geom.Area.<init>(Area.java:54)
at chemaxon.marvin.paint.internal.MolPainter.coverCrossingBonds(Unknown Source)
at chemaxon.marvin.paint.internal.MolPainter.bondLine(Unknown Source)
at chemaxon.marvin.paint.internal.MolPainter.bondLine(Unknown Source)
at chemaxon.marvin.paint.internal.MolPainter.paintBond(Unknown Source)
at chemaxon.marvin.paint.internal.MolPainter.paintObjects(Unknown Source)
at chemaxon.marvin.paint.internal.MolPainter.paintDocument(Unknown Source)
at chemaxon.marvin.MolPrinter.paint(Unknown Source)
at com.vpharm.library.cfx.chemistry.MolPainterBugReport.main(MolPainterBugReport.java:22)
when using the latest Marvin
import chemaxon.formats.MolImporter;
import chemaxon.marvin.MolPrinter;
import chemaxon.struc.Molecule;
import java.awt.*;
import java.awt.image.BufferedImage;
public class MolPainterBugReport {
public static void main(String[] args) throws Exception {
Molecule mol = MolImporter.importMol("C1CC2CC1CN2");
int width = 300;
int height = 300;
BufferedImage buff = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_INDEXED);
Graphics g = buff.getGraphics();
MolPrinter p = new MolPrinter(mol);
Rectangle r = new Rectangle(300, 300);
p.setScale(p.maxScale(r));
p.paint(g, r);
}
}