code: protected void paint(IDrawVisitor drawVisitor, IRenderingElement diagram) {
          if (diagram == null) return;
  
          // cache the diagram for quick-redraw
          this.cachedDiagram = diagram;
  
          fontManager.setFontName(rendererModel.getParameter(FontName.class).getValue());
          fontManager.setFontStyle(rendererModel.getParameter(UsedFontStyle.class).getValue());
  
          drawVisitor.setFontManager(this.fontManager);
          drawVisitor.setTransform(this.transform);
          drawVisitor.setRendererModel(this.rendererModel);
          diagram.accept(drawVisitor);
      }
docs: The target method for paintChemModel, paintReaction, and paintMolecule.
  
  @param drawVisitor
  the visitor to draw with
  @param diagram
  the IRenderingElement tree to render