Skip to content

Commit 36f29ce

Browse files
committed
Update JavaDoc, also constraint should be ring size < 8.
1 parent 1e6c28e commit 36f29ce

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardDonutGenerator.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646

4747
import static org.openscience.cdk.interfaces.IBond.Order.UNSET;
4848

49+
/**
50+
* Generates aromatic donuts (or life buoys) as ovals in small (<8) aromatic
51+
* rings. If the ring is charged (and the charged is not shared with another
52+
* ring, e.g. rbonds > 2) it will be depicted in the middle of the ring.
53+
*
54+
* @see ForceDelocalisedBondDisplay
55+
* @see DelocalisedDonutsBondDisplay
56+
*/
4957
final class StandardDonutGenerator {
5058

5159
// bonds involved in donuts!
@@ -63,7 +71,13 @@ final class StandardDonutGenerator {
6371
private final Font font;
6472
private final IAtomContainer mol;
6573

66-
public StandardDonutGenerator(IAtomContainer mol, Font font, RendererModel model) {
74+
/**
75+
* Create a new generator for a molecule.
76+
* @param mol molecule
77+
* @param font the font
78+
* @param model the rendering parameters
79+
*/
80+
StandardDonutGenerator(IAtomContainer mol, Font font, RendererModel model) {
6781
this.mol = mol;
6882
this.font = font;
6983
this.forceDelocalised = model.get(ForceDelocalisedBondDisplay.class);
@@ -75,7 +89,7 @@ public StandardDonutGenerator(IAtomContainer mol, Font font, RendererModel model
7589
}
7690

7791
private boolean canDelocalise(final IAtomContainer ring) {
78-
boolean okay = ring.getBondCount() <= 8;
92+
boolean okay = ring.getBondCount() < 8;
7993
if (!okay)
8094
return false;
8195
for (IBond bond : ring.bonds()) {

display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,13 +1156,16 @@ public Boolean getDefault() {
11561156
* there is a valid Kekule structure. Delocalised bonds will either be
11571157
* rendered as a dashed bond to the side or as a circle/donut/life buoy
11581158
* inside small rings. This depiction is used by default when a bond does
1159-
* not have an order assigned (e.g. null/unset). Turning this option on
1160-
* means all delocalised bonds will be rendered this way.
1159+
* not have an order assigned (e.g. null/unset), for example: c1cccc1.
1160+
* Turning this option on means all delocalised bonds will be rendered this
1161+
* way even when they have bond orders correctly assigned: e.g. c1ccccc1,
1162+
* [cH-]1cccc1.
11611163
* <br>
11621164
* <b>As recommended by IUPAC, their usage is discouraged and the Kekule
11631165
* representation is more clear.</b>
11641166
*/
1165-
public static final class ForceDelocalisedBondDisplay extends AbstractGeneratorParameter<Boolean> {
1167+
public static final class ForceDelocalisedBondDisplay
1168+
extends AbstractGeneratorParameter<Boolean> {
11661169

11671170
/**{@inheritDoc} */
11681171
@Override
@@ -1175,7 +1178,8 @@ public Boolean getDefault() {
11751178
* Render small delocalised rings as bonds/life buoys? This can sometimes
11761179
* be misleading for fused rings but is commonly used.
11771180
*/
1178-
public static final class DelocalisedDonutsBondDisplay extends AbstractGeneratorParameter<Boolean> {
1181+
public static final class DelocalisedDonutsBondDisplay
1182+
extends AbstractGeneratorParameter<Boolean> {
11791183

11801184
/**{@inheritDoc} */
11811185
@Override

0 commit comments

Comments
 (0)