boolean (@Nullable JFrame frame, Object processId, AppIconScheme.Progress scheme, double value, boolean isOk) { EDT.assertIsEdt(); BufferedImage appImage = getAppImage(); if (appImage == null) return false; myCurrentProcessId = processId; if (myLastValue > value) return true; if (Math.abs(myLastValue - value) < 0.02d) return true; try { double progressHeight = (myAppImage.getHeight() * 0.13); double xInset = (myAppImage.getWidth() * 0.05); double yInset = (myAppImage.getHeight() * 0.15); final double width = myAppImage.getWidth() - xInset * 2; final double y = myAppImage.getHeight() - progressHeight - yInset; Area borderArea = new Area( new RoundRectangle2D.Double( xInset - 1, y - 1, width + 2, progressHeight + 2, (progressHeight + 2), (progressHeight + 2 ))); Area backgroundArea = new Area(new Rectangle2D.Double(xInset, y, width, progressHeight)); backgroundArea.intersect(borderArea); Area progressArea = new Area(new Rectangle2D.Double(xInset + 1, y + 1,(width - 2) * value, progressHeight - 1)); progressArea.intersect(borderArea); Pair<BufferedImage, Graphics2D> appImg = myProgressImagesCache.get(myCurrentProcessId); if (appImg == null) myProgressImagesCache.put(myCurrentProcessId, appImg = createAppImage(appImage)); Graphics2D g2d = appImg.second; g2d.setColor(PROGRESS_BACKGROUND_COLOR); g2d.fill(backgroundArea); g2d.setColor(isOk ? scheme.getOkColor() : scheme.getErrorColor()); g2d.fill(progressArea); g2d.setColor(PROGRESS_OUTLINE_COLOR); g2d.draw(backgroundArea); g2d.draw(borderArea); setDockIcon(appImg.first); myLastValue = value; } catch (Exception e) { LOG.error(e); } finally { myCurrentProcessId = null; } return true; }