Browse Source

Merge pull request #1531 in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit 'a4584870bd2fa7b88e18d18c7233ffbd7e341208':
  REPORT-28186 mac出现短暂原生java图标问题
  REPORT-28368 死锁问题 常量不需要每次读取
feature/big-screen
Hades 5 years ago
parent
commit
6877b95101
  1. 14
      designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java
  2. BIN
      designer-base/src/main/resources/com/fr/design/icon/logo.png
  3. 4
      designer-realize/src/main/java/com/fr/start/Designer.java
  4. 26
      designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java

14
designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java

@ -83,6 +83,20 @@ public enum SupportOSImpl implements SupportOS {
public boolean support() { public boolean support() {
return OperatingSystem.isMacos(); return OperatingSystem.isMacos();
} }
},
NON_GUARDIAN_START {
@Override
public boolean support() {
return OperatingSystem.isLinux() || Arch.getArch() == Arch.ARM;
}
},
DOCK_ICON {
@Override
public boolean support() {
return OperatingSystem.isMacos();
}
} }
} }

BIN
designer-base/src/main/resources/com/fr/design/icon/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

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

@ -1,5 +1,6 @@
package com.fr.start; package com.fr.start;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
/** /**
@ -14,7 +15,8 @@ public class Designer {
public static void main(String[] args) { public static void main(String[] args) {
try { try {
if (DesignerJavaRuntime.getInstance().isInValidVmOptions()) { if (DesignerJavaRuntime.getInstance().isInValidVmOptions()
|| SupportOSImpl.NON_GUARDIAN_START.support()) {
runNonGuardianDesigner(args); runNonGuardianDesigner(args);
} else { } else {
// 创建进程 // 创建进程

26
designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java

@ -1,12 +1,18 @@
package com.fr.start; package com.fr.start;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.process.engine.core.AbstractJavaRuntime; import com.fr.process.engine.core.AbstractJavaRuntime;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import java.util.Set; import javax.imageio.ImageIO;
import java.io.File;
import java.io.IOException;
/** /**
* 设计器Java运行环境 * 设计器Java运行环境
@ -23,8 +29,20 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime {
private static final String JAVA_EXEC = "java"; private static final String JAVA_EXEC = "java";
private static final String WIN_JRE_BIN = StableUtils.pathJoin("jre", "bin"); private static final String WIN_JRE_BIN = StableUtils.pathJoin("jre", "bin");
private static final String MAC_JRE_BIN = StableUtils.pathJoin("jre.bundle", "Contents", "Home", "jre", "bin"); private static final String MAC_JRE_BIN = StableUtils.pathJoin("jre.bundle", "Contents", "Home", "jre", "bin");
private static final String BIN_HOME = StableUtils.pathJoin(StableUtils.getInstallHome(), "bin");
private static final String LOGO_PATH = StableUtils.pathJoin(BIN_HOME, "logo.png");
private static final String DOCK_OPTIONS = "-Xdock:icon=" + LOGO_PATH;
private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"}; private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"};
static {
if (SupportOSImpl.DOCK_ICON.support()) {
try {
ImageIO.write(IOUtils.readImage("com/fr/design/icon/logo.png"), "png", new File(LOGO_PATH));
} catch (IOException ignore) {
}
}
}
private static final DesignerJavaRuntime INSTANCE = new DesignerJavaRuntime(); private static final DesignerJavaRuntime INSTANCE = new DesignerJavaRuntime();
public static DesignerJavaRuntime getInstance() { public static DesignerJavaRuntime getInstance() {
@ -79,7 +97,11 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime {
@Override @Override
public String[] getJvmOptions() { public String[] getJvmOptions() {
if (isInstallVersion()) { if (isInstallVersion()) {
return super.getJvmOptions(); String[] options = super.getJvmOptions();
if (SupportOSImpl.DOCK_ICON.support()) {
options = ArrayUtils.add(options, DOCK_OPTIONS);
}
return options;
} else { } else {
return DEBUG_OPTIONS; return DEBUG_OPTIONS;
} }

Loading…
Cancel
Save