code: @Override
      public void paint(IAtomContainer atomContainer, IDrawVisitor drawVisitor, Rectangle2D bounds, boolean resetCenter) {
  
          if (atomContainer.getBondCount() > 0 || atomContainer.getAtomCount() == 1) {
              rendererModel.getParameter(Scale.class).setValue(
                      calculateScaleForBondLength(GeometryUtil.getBondLengthAverage(atomContainer)));
          } else if (atomContainer.getAtomCount() > 1) {
              rendererModel.getParameter(Scale.class).setValue(
                      calculateScaleForBondLength(estimatedBondLength(atomContainer)));
          }
  
          // the diagram to draw
          IRenderingElement diagram = generateDiagram(atomContainer);
  
          // the bounds of the model from 'Bounds' elements
          Rectangle2D modelBounds = getBounds(diagram);
  
          // no bounding elements, use the atom coordinates
          if (modelBounds == null) modelBounds = BoundsCalculator.calculateBounds(atomContainer);
  
          setupTransformToFit(bounds, modelBounds, resetCenter);
  
          this.paint(drawVisitor, diagram);
      }
docs: Paint a molecule (an IAtomContainer).
  
  @param atomContainer the molecule to paint
  @param drawVisitor the visitor that does the drawing
  @param bounds the bounds on the screen
  @param resetCenter
  if true, set the draw center to be the center of bounds