void (Graphics g) { super.paintComponent(g); final GraphicsConfig config = GraphicsUtil.setupAAPainting(g); Graphics2D g2 = (Graphics2D)g; if (myFraction > 1) { myFraction = 1; } Dimension size = getSize(); g2.setPaint(UIUtil.getListBackground()); Rectangle2D rect = new Rectangle2D.Double(2, 2, size.width - 4, size.height - 4); g2.fill(rect); g2.setPaint(new JBColor(SHADOW1, JBColor.border())); rect.setRect(1, 1, size.width - 2, size.height - 2); g2.drawRoundRect(1, 1, size.width - 2, size.height - 2, 5, 5); g2.setPaint(SHADOW2); g2.drawRoundRect(0, 0, size.width - 2, size.height - 2, 5, 5); int y_center = size.height / 2; int y_steps = size.height / 2 - 3; int alpha_step = y_steps > 0 ? (255 - 70) / y_steps : 255 - 70; int x_offset = 4; g.setClip(4, 3, size.width - 8, size.height - 6); int bricksToDraw = myFraction == 0 ? 0 : getBricksToDraw(myFraction); if (myIndeterminate) { int startFrom = bricksToDraw < INDETERMINATE_BRICKS_DRAW ? 0 : bricksToDraw - INDETERMINATE_BRICKS_DRAW; int endTo = Math.min(bricksToDraw + INDETERMINATE_BRICKS_DRAW, getBricksToDraw(1)); for (int i = startFrom; i <= endTo; i++) { g2.setPaint(myColor); int startXOffset = x_offset + (BRICK_WIDTH + BRICK_SPACE) * i; LinePainter2D.paint(g2, startXOffset, y_center, startXOffset + BRICK_WIDTH - 1, y_center); for (int j = 0; j < y_steps; j++) { Color color = ColorUtil.toAlpha(myColor, 255 - alpha_step * (j + 1)); g2.setPaint(color); LinePainter2D.paint(g2, startXOffset, y_center - 1 - j, startXOffset + BRICK_WIDTH - 1, y_center - 1 - j); if (!(y_center % 2 != 0 && j == y_steps - 1)) { LinePainter2D.paint(g2, startXOffset, y_center + 1 + j, startXOffset + BRICK_WIDTH - 1, y_center + 1 + j); } } g2.setColor( ColorUtil.toAlpha(myColor, 255 - alpha_step * (y_steps / 2 + 1))); g2.drawRect(startXOffset, y_center - y_steps, BRICK_WIDTH - 1, size.height - 7); } } else { for (int i = 0; i < bricksToDraw; i++) { g2.setPaint(myColor); LinePainter2D.paint(g2, x_offset, y_center, x_offset + BRICK_WIDTH - 1, y_center); for (int j = 0; j < y_steps; j++) { Color color = ColorUtil.toAlpha(myColor, 255 - alpha_step * (j + 1)); g2.setPaint(color); LinePainter2D.paint(g2, x_offset, y_center - 1 - j, x_offset + BRICK_WIDTH - 1, y_center - 1 - j); if (!(y_center % 2 != 0 && j == y_steps - 1)) { LinePainter2D.paint(g2, x_offset, y_center + 1 + j, x_offset + BRICK_WIDTH - 1, y_center + 1 + j); } } g2.setColor( ColorUtil.toAlpha(myColor, 255 - alpha_step * (y_steps / 2 + 1))); g2.drawRect(x_offset, y_center - y_steps, BRICK_WIDTH - 1, size.height - 7); x_offset += BRICK_WIDTH + BRICK_SPACE; } } config.restore(); }