From: SourceForge.net <no...@so...> - 2004-05-07 03:31:55
|
Bugs item #949638, was opened at 2004-05-07 11:31 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=120024&aid=949638&group_id=20024 Category: org.openscience.cdk.renderer Group: None Status: Open Resolution: None Priority: 5 Submitted By: Chris Pudney (cpudney) Assigned to: Nobody/Anonymous (nobody) Summary: Aromatic bonds (non-ring) not rendered Initial Comment: G'day, If a bond that is not in a ring has bond order == CDKConstants.BONDORDER_AROMATIC then it is not rendered. An example structure that produces this error is: c1(c(c(cc(c1O)[N+](=O)[O-])[N+](=O)[O-])C)C(C)C Bonds for the N+ atoms are not rendered. The problem appears to be that Renderer2D.paintBond() doesn't handle the case in which bond.getOrder() == CDKConstants.BONDORDER_AROMATIC. A workaround is to replace the final else block with the following: // Draw bond order when no stereo info is available double order = bond.getOrder(); if (order == CDKConstants.BONDORDER_SINGLE) { paintSingleBond(bond, bondColor, graphics); } else if (order == CDKConstants.BONDORDER_DOUBLE) { paintDoubleBond(bond, bondColor, graphics); } else if (order == CDKConstants.BONDORDER_TRIPLE) { paintTripleBond(bond, bondColor, graphics); } else { paintSingleBond(bond, bondColor, graphics); } A diff patch is attached. This fixes the problem and all jUnit tests pass. Regards, Chris. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=120024&aid=949638&group_id=20024 |