Browse Source

Merge pull request #292 in DESIGN/design from ~VITO/c-design:release/10.0 to release/10.0

* commit '588f9ed08b4448537b72b6a6a2b7df356287a10a':
  REPORT-10160 10.0冒烟 Mac设计器启动, 字体糊了
research/10.0
vito 6 years ago
parent
commit
311e8d7ae6
  1. 5
      designer-realize/src/main/java/com/fr/start/Designer.java
  2. 7
      designer-realize/src/main/java/com/fr/start/jni/SplashMac.java

5
designer-realize/src/main/java/com/fr/start/Designer.java

@ -150,6 +150,11 @@ public class Designer extends BaseDesigner {
private static SplashStrategy createSplash() {
// 这里可以开接口加载自定义启动画面
if (OperatingSystem.isWindows()) {
return new SplashFx();
} else if (OperatingSystem.isMacOS()) {
return new SplashMac();
}
return new SplashFx();
}

7
designer-realize/src/main/java/com/fr/start/jni/SplashMac.java

@ -7,6 +7,7 @@ import com.fr.stable.StringUtils;
import com.fr.start.SplashContext;
import com.fr.start.SplashStrategy;
import javax.swing.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@ -24,6 +25,7 @@ public class SplashMac implements SplashStrategy {
private SplashJNI jni;
private static final int EXILE = 10000;
public SplashMac() {
jni = new SplashJNI();
@ -62,6 +64,11 @@ public class SplashMac implements SplashStrategy {
@Override
public void show() {
if (jni != null) {
// mac下安装版模糊的hack
JFrame jFrame = new JFrame();
jFrame.setLocation(EXILE, EXILE);
jFrame.setVisible(true);
jFrame.setVisible(false);
File splash = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), SplashContext.SPLASH_CACHE_NAME));
String path = splash.exists() ? splash.getAbsolutePath() : loadResFromJar();
jni.show(path);

Loading…
Cancel
Save