void paint(@NotNull Graphics2D g) {
    if (g.getClipBounds() == null) {
      return;
    }

    BufferedImage buffer = Registry.is("editor.dumb.mode.available", true) ? getUserData(BUFFER) : null;
    if (buffer != null) {
      Rectangle rect = getContentComponent().getVisibleRect();
      StartupUiUtil.drawImage(g, buffer, null, rect.x, rect.y);
      return;
    }

    if (!shouldPaint()) {
      fillPlaceholder(g);
      return;
    }

    ApplicationManager.getApplication().runReadAction(() -> {
      if (myUpdateCursor && !myPurePaintingMode) {
        setCursorPosition();
        myUpdateCursor = false;
      }

      if (myProject != null && myProject.isDisposed()) {
        return;
      }

      myView.paint(g);
    });

    boolean isBackgroundImageSet = IdeBackgroundUtil.isEditorBackgroundImageSet(myProject);
    if (myBackgroundImageSet != isBackgroundImageSet) {
      myBackgroundImageSet = isBackgroundImageSet;
      updateOpaque(myScrollPane.getHorizontalScrollBar());
      updateOpaque(myScrollPane.getVerticalScrollBar());
    }
  }
void paint(@NotNull Graphics2D g)