|
79 | 79 | import java.util.Set; |
80 | 80 |
|
81 | 81 | /** |
82 | | - * Generates 2D coordinates for a molecule for which only connectivity is known |
83 | | - * or the coordinates have been discarded for some reason. Usage: Create an |
84 | | - * instance of this class, thereby assigning a molecule, call |
85 | | - * generateCoordinates() and get your molecule back: |
| 82 | + * Generates 2D coordinates for a molecule. |
| 83 | + * |
| 84 | + * <b>Basic Usage:</b> |
| 85 | + * If you just want to generate coordinate for a molecule (or reaction) you |
| 86 | + * can use the following one-liner: |
| 87 | + * <pre> |
| 88 | + * new StructureDiagramGenerator().generateCoordinates(molecule); |
| 89 | + * </pre> |
| 90 | + * The older versions of the API using the following a set/generate/get idiom |
| 91 | + * but this performs an unnecessary (in most cases) copy. |
86 | 92 | * <pre> |
87 | 93 | * StructureDiagramGenerator sdg = new StructureDiagramGenerator(); |
88 | | - * sdg.setMolecule(someMolecule); |
| 94 | + * sdg.setMolecule(molecule); // cloned! |
89 | 95 | * sdg.generateCoordinates(); |
90 | | - * IAtomContainer layedOutMol = sdg.getMolecule(); |
| 96 | + * molecule = sdg.getMolecule(); |
91 | 97 | * </pre> |
92 | | - * |
93 | | - * <p>The method will fail if the molecule is disconnected. The |
94 | | - * partitionIntoMolecules(AtomContainer) can help here. |
| 98 | + * This idiom only needs to be used when 'fixing' parts of an existing |
| 99 | + * layout: {@link #setMolecule(IAtomContainer, boolean, Set, Set)} |
| 100 | + * <br/> |
95 | 101 | * |
96 | 102 | * @author steinbeck |
97 | 103 | * @cdk.created 2004-02-02 |
|
104 | 110 | * @cdk.githash |
105 | 111 | * @cdk.bug 1536561 |
106 | 112 | * @cdk.bug 1788686 |
107 | | - * @see org.openscience.cdk.graph.ConnectivityChecker#partitionIntoMolecules(IAtomContainer) |
108 | 113 | */ |
109 | 114 | public class StructureDiagramGenerator { |
110 | 115 |
|
|
0 commit comments