code: protected final void draw(IDrawVisitor visitor, double zoom, Bounds bounds, Rectangle2D viewBounds) {
  
          double modelScale = zoom * model.get(BasicSceneGenerator.Scale.class);
          double zoomToFit = Math.min(viewBounds.getWidth() / (bounds.width() * modelScale),
                                      viewBounds.getHeight() / (bounds.height() * modelScale));
  
          AffineTransform transform = new AffineTransform();
          transform.translate(viewBounds.getCenterX(), viewBounds.getCenterY());
          transform.scale(modelScale, -modelScale);
  
          // default is shrink only unless specified
          if (model.get(BasicSceneGenerator.FitToScreen.class) || zoomToFit < 1)
              transform.scale(zoomToFit, zoomToFit);
  
          transform.translate(-(bounds.minX + bounds.maxX) / 2,
                              -(bounds.minY + bounds.maxY) / 2);
  
          // not always needed
          AWTFontManager fontManager = new AWTFontManager();
          fontManager.setFontForZoom(zoomToFit);
  
          visitor.setRendererModel(model);
          visitor.setFontManager(fontManager);
          visitor.setTransform(transform);
  
          // setup up transform
          visitor.visit(bounds.root());
      }
docs: Low-level draw method used by other rendering methods.
  
  @param visitor    the draw visitor
  @param bounds     a bound rendering element
  @param zoom       if the diagram is zoomed at all
  @param viewBounds the view bounds - the root will be centered in the bounds