FlatSVGIcon: no longer use classes from package com.formdev.flatlaf.ui to allow using FlatSVGIcon (and flatlaf-extras.jar) in NetBeans plugin (NetBeans ships with FlatLaf, but does not export that package)

This commit is contained in:
Karl Tauber
2022-11-14 14:02:27 +01:00
parent 3e6bce9cec
commit aefe104ca4

View File

@@ -43,7 +43,6 @@ import javax.swing.UIManager;
import com.formdev.flatlaf.FlatIconColors; import com.formdev.flatlaf.FlatIconColors;
import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.FlatLaf.DisabledIconProvider; import com.formdev.flatlaf.FlatLaf.DisabledIconProvider;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.Graphics2DProxy; import com.formdev.flatlaf.util.Graphics2DProxy;
import com.formdev.flatlaf.util.GrayFilter; import com.formdev.flatlaf.util.GrayFilter;
import com.formdev.flatlaf.util.LoggingFacade; import com.formdev.flatlaf.util.LoggingFacade;
@@ -584,7 +583,11 @@ public class FlatSVGIcon
Graphics2D g2 = new GraphicsFilter( (Graphics2D) g.create(), colorFilter, ColorFilter.getInstance(), grayFilter ); Graphics2D g2 = new GraphicsFilter( (Graphics2D) g.create(), colorFilter, ColorFilter.getInstance(), grayFilter );
try { try {
FlatUIUtils.setRenderingHints( g2 ); // same hints as in FlatUIUtils.setRenderingHints()
g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
g2.setRenderingHint( RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE );
// enable better image scaling
g2.setRenderingHint( RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR ); g2.setRenderingHint( RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR );
paintSvg( g2, x, y ); paintSvg( g2, x, y );