diff --git a/designer-realize/src/main/java/com/fr/start/common/SplashPane.java b/designer-realize/src/main/java/com/fr/start/common/SplashPane.java index edc70a6fa7..535ace2d24 100644 --- a/designer-realize/src/main/java/com/fr/start/common/SplashPane.java +++ b/designer-realize/src/main/java/com/fr/start/common/SplashPane.java @@ -1,9 +1,9 @@ package com.fr.start.common; +import com.bulenkov.iconloader.IconLoader; import com.bulenkov.iconloader.util.JBUI; import com.fr.base.GraphHelper; import com.fr.design.DesignerEnvManager; -import com.fr.general.IOUtils; import com.fr.general.locale.image.I18nImage; import com.fr.stable.GraphDrawHelper; import com.fr.stable.GraphicsConfig; @@ -12,14 +12,13 @@ import com.fr.stable.os.OperatingSystem; import com.fr.value.NotNullLazyValue; import org.jetbrains.annotations.NotNull; +import javax.swing.Icon; import javax.swing.JPanel; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.RenderingHints; -import java.awt.image.BufferedImage; import java.util.Locale; /** @@ -51,12 +50,10 @@ public class SplashPane extends JPanel { private String thanksLog = StringUtils.EMPTY; private String moduleText = StringUtils.EMPTY; - protected BufferedImage splashImg; - /** - * 默认使用两倍图 + * 正常图片路径 */ - private static final String SPLASH_PATH = "/com/fr/design/images/splash@2x.png"; + private static final String SPLASH_PATH = "/com/fr/design/images/splash.png"; private static int uiScale(int i) { return (int) (i * JBUI_INIT_SCALE); @@ -66,10 +63,6 @@ public class SplashPane extends JPanel { return I18nImage.getImagePath(SPLASH_PATH, DesignerEnvManager.getEnvManager().getLanguage()); } - public SplashPane() { - this.splashImg = IOUtils.readImage(OEM_PATH); - } - private NotNullLazyValue fontValue = new NotNullLazyValue() { @NotNull @Override @@ -88,20 +81,10 @@ public class SplashPane extends JPanel { @Override protected void paintComponent(Graphics g) { super.paintComponent(g); - Graphics2D g2d = (Graphics2D) g.create(); - try { - Dimension dimension = getSplashDimension(); - - g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); - g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - - g2d.drawImage(splashImg, 0, 0, (int) dimension.getWidth(), (int) dimension.getHeight(), this); - - paintShowText(g2d); - } finally { - g2d.dispose(); - } + Icon icon = IconLoader.getIcon(OEM_PATH); + icon.paintIcon(null, g, 0, 0); + paintShowText((Graphics2D) g); + g.dispose(); } @@ -123,11 +106,8 @@ public class SplashPane extends JPanel { } Dimension getSplashDimension() { - // 默认使用两倍图,缩放绘制,保证高分屏的清晰度 - float imageScale = JBUI_INIT_SCALE / 2.0f; - int targetWidth = Math.round(splashImg.getWidth() * imageScale); - int targetHeight = Math.round(splashImg.getHeight() * imageScale); - return new Dimension(targetWidth, targetHeight); + Icon icon = IconLoader.getIcon(OEM_PATH); + return new Dimension(icon.getIconWidth(), icon.getIconHeight()); } private boolean isDialogFont(Font font) { diff --git a/designer-realize/src/main/java/com/fr/start/common/SplashWindow.java b/designer-realize/src/main/java/com/fr/start/common/SplashWindow.java index 35a5907ec9..8b4ac0a48f 100644 --- a/designer-realize/src/main/java/com/fr/start/common/SplashWindow.java +++ b/designer-realize/src/main/java/com/fr/start/common/SplashWindow.java @@ -32,7 +32,12 @@ public class SplashWindow extends JFrame { initTitleIcon(); //slash pane - this.splash = new SplashPane(); + // 如果是Windows + JDK版本大于等于9时,一倍图启动会很模糊,这边使用两倍图 + if (OperatingSystem.isWindows() && JdkVersion.GE_9.support()) { + this.splash = new SplashPane4WinAndJDK11(); + } else { + this.splash = new SplashPane(); + } splash.setBackground(null); this.setContentPane(splash); diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash.png b/designer-realize/src/main/resources/com/fr/design/images/splash.png index 92c01b5283..deea7d10fc 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash.png and b/designer-realize/src/main/resources/com/fr/design/images/splash.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash@2x.png b/designer-realize/src/main/resources/com/fr/design/images/splash@2x.png index 1bcf5d1bc9..908779106c 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash@2x.png and b/designer-realize/src/main/resources/com/fr/design/images/splash@2x.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash@2x_en.png b/designer-realize/src/main/resources/com/fr/design/images/splash@2x_en.png index 1bcf5d1bc9..908779106c 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash@2x_en.png and b/designer-realize/src/main/resources/com/fr/design/images/splash@2x_en.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh.png b/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh.png index 2748c30aaa..ac6381b31f 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh.png and b/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh_TW.png b/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh_TW.png index 246a76bac8..243d1b0cf3 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh_TW.png and b/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh_TW.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash_en.png b/designer-realize/src/main/resources/com/fr/design/images/splash_en.png index 92c01b5283..deea7d10fc 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash_en.png and b/designer-realize/src/main/resources/com/fr/design/images/splash_en.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash_zh.png b/designer-realize/src/main/resources/com/fr/design/images/splash_zh.png index 935d061e24..24ffb1ceea 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash_zh.png and b/designer-realize/src/main/resources/com/fr/design/images/splash_zh.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash_zh_TW.png b/designer-realize/src/main/resources/com/fr/design/images/splash_zh_TW.png index 3250cbfe33..86949f2040 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash_zh_TW.png and b/designer-realize/src/main/resources/com/fr/design/images/splash_zh_TW.png differ