IDEA-140577 NPE in splash screen

This commit is contained in:
Denis Fokin
2015-05-21 15:37:40 +03:00
parent a007ab5ea2
commit b463dbbe75
2 changed files with 15 additions and 1 deletions
@@ -166,7 +166,7 @@ public class Splash extends JDialog implements StartupProgress {
if (ApplicationInfoImpl.getShadowInstance().showLicenseeInfo()) {
final LicensingFacade provider = LicensingFacade.getInstance();
if (provider != null) {
UISettings.setupAntialiasing(g);
UIUtil.applyRenderingHints(g);
g.setFont(new Font(UIUtil.ARIAL_FONT_NAME, Font.BOLD, JBUI.scale(SystemInfo.isUnix ? 10 : 11)));
g.setColor(textColor);
@@ -1761,6 +1761,20 @@ public class UIUtil {
return image;
}
/** This method is intended to use when user settings are not accessible yet.
* Use it to set up default RenderingHints.
* @param g
*/
public static void applyRenderingHints(final Graphics g) {
Graphics2D g2d = (Graphics2D)g;
Toolkit tk = Toolkit.getDefaultToolkit();
//noinspection HardCodedStringLiteral
Map map = (Map)tk.getDesktopProperty("awt.font.desktophints");
if (map != null) {
g2d.addRenderingHints(map);
}
}
public static BufferedImage createImage(int width, int height, int type) {
if (isRetina()) {
return RetinaImage.create(width, height, type);