|
|
|
@ -8,6 +8,7 @@ import com.formdev.flatlaf.FlatLaf;
|
|
|
|
|
import com.formdev.flatlaf.ui.FlatUIUtils; |
|
|
|
|
import com.formdev.flatlaf.util.GrayFilter; |
|
|
|
|
import com.fr.clone.cloning.Immutable; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.value.NullableLazyValue; |
|
|
|
|
import com.github.weisj.jsvg.SVGDocument; |
|
|
|
|
import com.github.weisj.jsvg.attributes.ViewBox; |
|
|
|
@ -112,6 +113,7 @@ public class SvgIcon implements DisabledIcon, WhiteIcon, Icon {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void render(Component c, Graphics g, int x, int y) { |
|
|
|
|
try { |
|
|
|
|
if (type == Type.white) { |
|
|
|
|
Objects.requireNonNull(whiteSvgDocument.getValue()) |
|
|
|
|
.render((JComponent) c, (Graphics2D) g, new ViewBox(x, y, size.width, size.height)); |
|
|
|
@ -119,6 +121,9 @@ public class SvgIcon implements DisabledIcon, WhiteIcon, Icon {
|
|
|
|
|
Objects.requireNonNull(svgDocument.getValue()) |
|
|
|
|
.render((JComponent) c, (Graphics2D) g, new ViewBox(x, y, size.width, size.height)); |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error("SvgIcon from url: " + resource + "can not paint.", e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|