// the molecule set should not be null, but just in case...
if (set == null) {
set = chemModel.getBuilder().newInstance(IAtomContainerSet.class);
chemModel.setMoleculeSet(set);
}
IAtomContainer newAtomContainer = chemModel.getBuilder().newInstance(IAtomContainer.class);
if (chemModel.getMoleculeSet().getAtomContainer(0).getAtomCount() == 0)
newAtomContainer = (IAtomContainer) chemModel.getMoleculeSet()
.getAtomContainer(0);
else
chemModel.getMoleculeSet().addAtomContainer(newAtomContainer);
newAtomContainer.add(ring);
updateAtoms(ring, ring.atoms());
structureChanged();
if (undoable && getUndoRedoFactory() != null
&& getUndoRedoHandler() != null) {
IUndoRedoable undoredo = getUndoRedoFactory()