diff --git a/designer-base/src/main/java/com/fine/theme/icon/GraphicsFilter.java b/designer-base/src/main/java/com/fine/theme/icon/GraphicsFilter.java index 63f86df5db..f35c1b67f8 100644 --- a/designer-base/src/main/java/com/fine/theme/icon/GraphicsFilter.java +++ b/designer-base/src/main/java/com/fine/theme/icon/GraphicsFilter.java @@ -41,8 +41,9 @@ public class GraphicsFilter @Override public void setPaint(Paint paint) { - if (paint instanceof Color) + if (paint instanceof Color) { paint = filterColor((Color) paint); + } super.setPaint(paint); } diff --git a/designer-base/src/main/java/com/fine/theme/icon/svg/SvgIcon.java b/designer-base/src/main/java/com/fine/theme/icon/svg/SvgIcon.java index df5a52e787..37c399e5d4 100644 --- a/designer-base/src/main/java/com/fine/theme/icon/svg/SvgIcon.java +++ b/designer-base/src/main/java/com/fine/theme/icon/svg/SvgIcon.java @@ -42,7 +42,18 @@ import static com.fine.theme.utils.FineUIScale.scale; public class SvgIcon implements DisabledIcon, WhiteIcon, Icon { public enum Type { - disable, white, origin + /** + * 灰化图 + */ + disable, + /** + * 白化图,用于反白场景 + */ + white, + /** + * 原始效果图 + */ + origin } private final Dimension size; @@ -74,14 +85,14 @@ public class SvgIcon implements DisabledIcon, WhiteIcon, Icon { @Override public void paintIcon(Component c, Graphics g, int x, int y) { if (type == Type.disable) { - g = GrayGraphics(g); + g = grayGraphics(g); } Object[] oldRenderingHints = FlatUIUtils.setRenderingHints(g); render(c, g, x, y); FlatUIUtils.resetRenderingHints(g, oldRenderingHints); } - public Graphics2D GrayGraphics(Graphics g) { + public Graphics2D grayGraphics(Graphics g) { Object grayFilterObj = UIManager.get("Component.grayFilter"); RGBImageFilter grayFilter = (grayFilterObj instanceof RGBImageFilter) ? (RGBImageFilter) grayFilterObj