void (@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(controlWidth / 2); int indent = left + getRightIndent(); x += left - controlWidth / 2; int controlX = !leaf && depth > 1 ? (depth - 1) * indent + x : x; if (paintLines && (depth != 1 || (!leaf && expanded))) { g.setColor(LINE_COLOR); while (--depth > 0) { paintLine(g, x, y, controlWidth, height); x += indent; } if (!leaf && expanded) { int offset = (height - control.getHeight()) / 2; if (offset > 0) paintLine(g, x, y + height - offset, controlWidth, offset); } } if (leaf) return; // do not paint control for a leaf node control.paint(c, g, controlX, y, controlWidth, height, expanded, selected); }