@Override public void paintIcon(Component c, Graphics g, int x, int y) { for (ResizableIcon layer : layers) layer.paintIcon(c, g, x, y); } }
@Override public void paintIcon(Component c, Graphics g, int x, int y) { delegate.paintIcon(c, g, x, y); }
@Override public void paintIcon(Component c, Graphics g, int x, int y) { currentIcon.paintIcon(c, g, x, y); }
/** * Paints the icon of the popup area. * * @param g * Graphics context. * @param popupActionRect */ protected void paintPopupActionIcon(Graphics g, Rectangle popupActionRect) { int size = Math.max(popupActionRect.width - 2, 7); if (size % 2 == 0) size--; popupActionIcon.setDimension(new Dimension(size, size)); popupActionIcon.paintIcon(this.commandButton, g, popupActionRect.x + (popupActionRect.width - size) / 2, popupActionRect.y + (popupActionRect.height - size) / 2); }
@Override public void paintIcon(Component c, Graphics g, int x, int y) { this.delegate.paintIcon(c, g, x, y); for (IconDecorator decorator : this.decorators) { decorator.paintIconDecoration(c, g, x, y, this.delegate .getIconWidth(), this.delegate.getIconHeight()); } }
@Override public void paintIcon(Component c, Graphics g, int x, int y) { // check cache String key = this.getIconWidth() + ":" + this.getIconHeight(); if (!this.cachedImages.containsKey(key)) { // check if loading if (this.delegate instanceof AsynchronousLoading) { AsynchronousLoading asyncDelegate = (AsynchronousLoading) this.delegate; // if the delegate is still loading - do nothing if (asyncDelegate.isLoading()) return; } BufferedImage offscreen = FlamingoUtilities.getBlankImage(this .getIconWidth(), this.getIconHeight()); Graphics2D g2d = offscreen.createGraphics(); this.delegate.paintIcon(c, g2d, 0, 0); g2d.dispose(); BufferedImage filtered = this.operation.filter(offscreen, null); this.cachedImages.put(key, filtered); } g.drawImage(this.cachedImages.get(key), x, y, null); } }
icon.paintIcon(null, g2d, 0, 0); g2d.dispose(); return result;