|
|
|
@ -2,7 +2,7 @@ package com.fr.design.icon;
|
|
|
|
|
|
|
|
|
|
import com.fr.base.svg.SVGLoader; |
|
|
|
|
import com.fr.base.svg.SystemScaleUtils; |
|
|
|
|
import com.fr.design.utils.SvgPaintWorker; |
|
|
|
|
import com.fr.design.utils.SvgPainter; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
|
|
|
|
|
import javax.swing.GrayFilter; |
|
|
|
@ -45,20 +45,20 @@ public class WarningIcon extends ImageIcon {
|
|
|
|
|
//裁剪绘制svg的位置,以免影响到图标右侧的文字
|
|
|
|
|
Graphics2D graphics = (Graphics2D) g.create(x, y, WARNING_IMAGE.getWidth(null), WARNING_IMAGE.getHeight(null)); |
|
|
|
|
if (mainImage != null) { |
|
|
|
|
new SvgPaintWorker(graphics) { |
|
|
|
|
new SvgPainter(graphics) { |
|
|
|
|
@Override |
|
|
|
|
protected void doPrint() { |
|
|
|
|
protected void doPaint() { |
|
|
|
|
this.drawImage(mainImage, x, y, null); |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
}.paint(); |
|
|
|
|
} |
|
|
|
|
if (WARNING_IMAGE != null) { |
|
|
|
|
new SvgPaintWorker(graphics) { |
|
|
|
|
new SvgPainter(graphics) { |
|
|
|
|
@Override |
|
|
|
|
protected void doPrint() { |
|
|
|
|
protected void doPaint() { |
|
|
|
|
this.drawImage(WARNING_IMAGE, x, y, null); |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
}.paint(); |
|
|
|
|
} |
|
|
|
|
graphics.dispose(); |
|
|
|
|
} |
|
|
|
|