diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/DoubleSplashMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/DoubleSplashMark.java new file mode 100644 index 0000000000..78ee72b508 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/locale/impl/DoubleSplashMark.java @@ -0,0 +1,33 @@ +package com.fr.design.locale.impl; + +import com.fr.design.DesignerEnvManager; +import com.fr.general.locale.LocaleMark; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/9/2 + */ +public class DoubleSplashMark implements LocaleMark { + + private final Map map = new HashMap(); + private static final String SPLASH_PATH_X2 = "/com/fr/design/images/splash@2x.png"; + private static final String SPLASH_PATH_EN_X2 = "/com/fr/design/images/splash_en@2x.png"; + + public DoubleSplashMark() { + map.put(Locale.CHINA, SPLASH_PATH_X2); + map.put(Locale.KOREA, SPLASH_PATH_EN_X2); + map.put(Locale.JAPAN, SPLASH_PATH_EN_X2); + map.put(Locale.US, SPLASH_PATH_EN_X2); + map.put(Locale.TAIWAN, SPLASH_PATH_EN_X2); + } + + @Override + public String getValue() { + String result = map.get(DesignerEnvManager.getEnvManager().getLanguage()); + return result == null ? SPLASH_PATH_EN_X2 : result; + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java index 8cf75c0587..93995eeddc 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/SplashMark.java @@ -15,8 +15,8 @@ import java.util.Map; public class SplashMark implements LocaleMark { private Map map = new HashMap(); - private static final String SPLASH_PATH = "/com/fr/design/images/splash_10.png"; - private static final String SPLASH_EN_PATH = "/com/fr/design/images/splash_10_en.png"; + private static final String SPLASH_PATH = "/com/fr/design/images/splash.png"; + private static final String SPLASH_EN_PATH = "/com/fr/design/images/splash_en.png"; public SplashMark() { map.put(Locale.CHINA, SPLASH_PATH); diff --git a/designer-realize/src/main/java/com/fr/start/common/SplashPane4WinAndJDK11.java b/designer-realize/src/main/java/com/fr/start/common/SplashPane4WinAndJDK11.java index fea7deb3cc..458020b587 100644 --- a/designer-realize/src/main/java/com/fr/start/common/SplashPane4WinAndJDK11.java +++ b/designer-realize/src/main/java/com/fr/start/common/SplashPane4WinAndJDK11.java @@ -2,6 +2,7 @@ package com.fr.start.common; import com.bulenkov.iconloader.IconLoader; import com.fr.base.BaseUtils; +import com.fr.design.locale.impl.DoubleSplashMark; import com.fr.design.locale.impl.SplashMark; import com.fr.general.IOUtils; import com.fr.general.locale.LocaleCenter; @@ -28,24 +29,18 @@ public class SplashPane4WinAndJDK11 extends SplashPane{ */ private boolean isDouble = false; - private static final String IMAGE_SPLASH = "splash_10.png"; - - private static final String IMAGE_SPLASH_DOUBLE = "splash_10@2x.png"; - public SplashPane4WinAndJDK11() { this.imagePath = getSplashPath4WinAndJdk11(); } private String getSplashPath4WinAndJdk11() { String path = (String) LocaleCenter.getMark(SplashMark.class).getValue(); - if (path.contains(IMAGE_SPLASH)) { - // 为图片加上"@2x" - String pathOfDouble = path.replace(IMAGE_SPLASH, IMAGE_SPLASH_DOUBLE); - // 某些定制jar里面没有两倍图,判断一下,如果文件不存在,就返回一倍图的path - if (IOUtils.readResource(pathOfDouble) != null) { - this.isDouble = true; - return pathOfDouble; - } + String pathOfDouble = (String) LocaleCenter.getMark(DoubleSplashMark.class).getValue(); + // 为图片加上"@2x" + // 某些定制jar里面没有两倍图,判断一下,如果文件不存在,就返回一倍图的path + if (IOUtils.readResource(pathOfDouble) != null) { + this.isDouble = true; + return pathOfDouble; } return path; } 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 new file mode 100644 index 0000000000..395d1d2a61 Binary files /dev/null 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 new file mode 100644 index 0000000000..1ef35c2b01 Binary files /dev/null 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_10.png b/designer-realize/src/main/resources/com/fr/design/images/splash_10.png deleted file mode 100644 index 088d124b9b..0000000000 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash_10.png and /dev/null differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash_10@2x.png b/designer-realize/src/main/resources/com/fr/design/images/splash_10@2x.png deleted file mode 100644 index 0ce87ae6f9..0000000000 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash_10@2x.png and /dev/null differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash_10_en.png b/designer-realize/src/main/resources/com/fr/design/images/splash_10_en.png deleted file mode 100644 index db254316f1..0000000000 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash_10_en.png and /dev/null 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 new file mode 100644 index 0000000000..42538c0054 Binary files /dev/null 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_en@2x.png b/designer-realize/src/main/resources/com/fr/design/images/splash_en@2x.png new file mode 100644 index 0000000000..eaed5f1af7 Binary files /dev/null and b/designer-realize/src/main/resources/com/fr/design/images/splash_en@2x.png differ