@Override
  public void paint(@NotNull Component c, @NotNull Graphics g, int x, int y, int width, int height,
                    @NotNull Control control, int depth, boolean leaf, boolean expanded, boolean selected) {
    if (depth <= 0) return; // do not paint
    boolean paintLines = getPaintLines();
    if (!paintLines && leaf) return; // nothing to paint
    int controlWidth = control.getWidth();
    int left = getLeftIndent();
    int indent = left + JBUIScale.scale(2);
    x += left;
    int controlX = !leaf && depth > 1 ? (depth - 1) * indent + x : x;
    if (paintLines && (depth != 1 || (!leaf && expanded))) {
      g.setColor(LINE_COLOR);
      x += JBUIScale.scale(1);
      while (--depth > 0) {
        g.drawLine(x, y, x, y + height);
        x += indent;
      }
      if (!leaf && expanded) {
        int offset = height / 2 - control.getIcon(expanded, selected).getIconHeight() / 4;
        if (offset > 0) g.drawLine(x, y + height - offset, x, y + height);
      }
    }
    if (leaf) return; // do not paint control for a leaf node
    control.paint(c, g, controlX, y, controlWidth, height, expanded, selected);
  }
@Override
  public void paint(@NotNull Component c, @NotNull Graphics g, int x, int y, int width, int height,
                    @NotNull Control control, int depth, boolean leaf, boolean expanded, boolean selected)