Browse Source

REPORT-10160 10.0冒烟 Mac设计器启动, 字体糊了

research/10.0
vito 6 years ago
parent
commit
588f9ed08b
  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() { private static SplashStrategy createSplash() {
// 这里可以开接口加载自定义启动画面 // 这里可以开接口加载自定义启动画面
if (OperatingSystem.isWindows()) {
return new SplashFx();
} else if (OperatingSystem.isMacOS()) {
return new SplashMac();
}
return new SplashFx(); 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.SplashContext;
import com.fr.start.SplashStrategy; import com.fr.start.SplashStrategy;
import javax.swing.*;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
@ -24,6 +25,7 @@ public class SplashMac implements SplashStrategy {
private SplashJNI jni; private SplashJNI jni;
private static final int EXILE = 10000;
public SplashMac() { public SplashMac() {
jni = new SplashJNI(); jni = new SplashJNI();
@ -62,6 +64,11 @@ public class SplashMac implements SplashStrategy {
@Override @Override
public void show() { public void show() {
if (jni != null) { 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)); File splash = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), SplashContext.SPLASH_CACHE_NAME));
String path = splash.exists() ? splash.getAbsolutePath() : loadResFromJar(); String path = splash.exists() ? splash.getAbsolutePath() : loadResFromJar();
jni.show(path); jni.show(path);

Loading…
Cancel
Save