diff --git a/designer-realize/src/com/fr/design/images/splash_10.gif b/designer-realize/src/com/fr/design/images/splash_10.gif index 0f099397e5..36b362649f 100644 Binary files a/designer-realize/src/com/fr/design/images/splash_10.gif and b/designer-realize/src/com/fr/design/images/splash_10.gif differ diff --git a/designer-realize/src/com/fr/start/SplashContext.java b/designer-realize/src/com/fr/start/SplashContext.java index 9ba4a72b14..b281cf976b 100644 --- a/designer-realize/src/com/fr/start/SplashContext.java +++ b/designer-realize/src/com/fr/start/SplashContext.java @@ -23,6 +23,9 @@ import java.util.concurrent.TimeUnit; */ public class SplashContext { + public static final String SPLASH_PATH = "/com/fr/design/images/splash_10.gif"; + public static final String SPLASH_CACHE_NAME = "splash_10.gif"; + private static final SplashContext SPLASH_CONTEXT = new SplashContext(); private SplashStrategy splashStrategy; diff --git a/designer-realize/src/com/fr/start/fx/SplashFxWindow.java b/designer-realize/src/com/fr/start/fx/SplashFxWindow.java index 451fad60db..e4d845d271 100644 --- a/designer-realize/src/com/fr/start/fx/SplashFxWindow.java +++ b/designer-realize/src/com/fr/start/fx/SplashFxWindow.java @@ -3,6 +3,7 @@ package com.fr.start.fx; import com.bulenkov.iconloader.util.JBUI; import com.fr.base.FRContext; import com.fr.stable.OperatingSystem; +import com.fr.start.SplashContext; import javafx.application.Application; import javafx.application.Platform; import javafx.scene.Scene; @@ -37,9 +38,8 @@ public class SplashFxWindow extends Application { private static final int WINDOW_WIDTH = 640; private static final int WINDOW_HEIGHT = 360; private static final int FONT = 12; - private static final int FRAME_COUNT = 254; + private static final int FRAME_COUNT = 315; private static final String THINKS_COLOR = "#82b1ce"; - private static final String SPLASH_PATH = "/com/fr/design/images/splash_10.gif"; private static final CountDownLatch LATCH = new CountDownLatch(1); private static SplashFxWindow app = null; @@ -78,7 +78,7 @@ public class SplashFxWindow extends Application { public void start(Stage primaryStage) { AnchorPane root = new AnchorPane(); primaryStage.initStyle(StageStyle.TRANSPARENT); - Image image = new FastGifImage(SPLASH_PATH, FRAME_COUNT, WINDOW_WIDTH, WINDOW_HEIGHT); + Image image = new FastGifImage(SplashContext.SPLASH_PATH, FRAME_COUNT, WINDOW_WIDTH, WINDOW_HEIGHT); ImageView gif = new ImageView(image); diff --git a/designer-realize/src/com/fr/start/jni/SplashMac.java b/designer-realize/src/com/fr/start/jni/SplashMac.java index c5c8ee63e5..f4e900aecb 100644 --- a/designer-realize/src/com/fr/start/jni/SplashMac.java +++ b/designer-realize/src/com/fr/start/jni/SplashMac.java @@ -22,8 +22,6 @@ import java.io.InputStream; */ public class SplashMac implements SplashStrategy { - private static final String SPLASH_CACHE_NAME = "splash_10.gif"; - private static final String SPLASH_PATH = "/com/fr/design/images/splash_10.gif"; private SplashJNI jni; @@ -38,12 +36,12 @@ public class SplashMac implements SplashStrategy { */ private static String loadResFromJar() { File tempLib = null; - try (InputStream inputStream = SplashContext.class.getResourceAsStream(SplashMac.SPLASH_PATH)) { + try (InputStream inputStream = SplashContext.class.getResourceAsStream(SplashContext.SPLASH_PATH)) { if (inputStream == null) { - FRContext.getLogger().error("Unable to copy " + SplashMac.SPLASH_PATH + " from jar file."); + FRContext.getLogger().error("Unable to copy " + SplashContext.SPLASH_PATH + " from jar file."); return StringUtils.EMPTY; } - tempLib = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), SPLASH_CACHE_NAME)); + tempLib = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), SplashContext.SPLASH_CACHE_NAME)); byte[] buffer = new byte[1024]; int read = -1; try (FileOutputStream fileOutputStream = new FileOutputStream(tempLib)) { @@ -57,14 +55,14 @@ public class SplashMac implements SplashStrategy { tempLib.deleteOnExit(); } // 直接抛异常 - throw new RuntimeException("Unable to copy " + SplashMac.SPLASH_PATH + " from jar file."); + throw new RuntimeException("Unable to copy " + SplashContext.SPLASH_PATH + " from jar file."); } } @Override public void show() { if (jni != null) { - File splash = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), SPLASH_CACHE_NAME)); + File splash = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), SplashContext.SPLASH_CACHE_NAME)); String path = splash.exists() ? splash.getAbsolutePath() : loadResFromJar(); jni.show(path); }