eirikbakke opened a new pull request, #8114: URL: https://github.com/apache/netbeans/pull/8114
Background: To ensure that SVG icons are drawn at full resolution, direct use of ImageIcon constructors should be avoided in the NetBeans codebase, as such Icon instances will be painted as bitmaps rather than as vector graphics. The ImageIcon instances returned from methods in ImageUtilities, by contrast, are instances of a special subclass of ImageIcon that does not have this problem. During work to remove uses of "new ImageIcon" constructors in the codebase (including https://github.com/apache/netbeans/pull/8109), I see that a few new utility methods would be useful in ImageUtilities. This PR adds the following methods to ImageUtilities: * loadIcon(String,boolean) works like loadIconImage(String,boolean) but returns only a plain Icon (not IconImage). This would help discourage use of IconImage in the future. * loadIcon(String) is equivalent to loadIcon(String,false) * toImageIcon(Icon) helps cases where an existing API requires an ImageIcon to be returned, but where we only have an Icon. * loadImage(URL) helps migrate away from uses of Toolkit.getDefaultToolkit().createImage(), which has similar problems as "new ImageIcon". This PR also contains, in a separate commit, migration away from the Toolkit.getDefaultToolkit().createImage() method, using the new loadImage(URL) method. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
