From fc9c029ec720f7402429dc0b21fcea29fbc71359 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 25 Mar 2020 19:45:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-28368=20=E6=AD=BB=E9=94=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E5=B8=B8=E9=87=8F=E4=B8=8D=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=AF=8F=E6=AC=A1=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/os/impl/SupportOSImpl.java | 14 ++++++++++ .../resources/com/fr/design/icon/logo.png | Bin 0 -> 2478 bytes .../src/main/java/com/fr/start/Designer.java | 4 ++- .../com/fr/start/DesignerJavaRuntime.java | 26 ++++++++++++++++-- 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/icon/logo.png diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java index 2518ef57c..f6c0e3054 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java @@ -83,6 +83,20 @@ public enum SupportOSImpl implements SupportOS { public boolean support() { 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(); + } } } diff --git a/designer-base/src/main/resources/com/fr/design/icon/logo.png b/designer-base/src/main/resources/com/fr/design/icon/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d4c7d8b24d0c6dc5c2792e5749f70a2e1b3e54b5 GIT binary patch literal 2478 zcmb_eX;_n27CuQZp~zw>DhLvkQE)3*6tocd#JJ!Z6;T0Md{hun+)yBpd}9@?&L~5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bpM&(!x|jmxca%Q zqw}n`2B&SRrPhjDurtR{W*GZj2hxGRuU01hpq29R$8W*5=cOr1%prO@mS3SXPseov zJEfP;do%RnV?7C}N|^vZH#ouqjgh*(_-C0K&*i8#@(t3qHe&(h*)`&((T`Y=rRy}@ z9%wgqY;L$p-y8iuI(4)1>NC}aNVMMX_I4J{mAyK~Y`&Ky!1o4}u{Hl;r~{Lx)EY zbm7+@z$cOx#1Jk!8@wvkH(&}FY zVeYj6lGhW4&M>=E1~w(DV!efed05xPe=bhg9=SKy!@==fZ+YX4?J+z2Y-7-gG51ns z>VgkM?oC0DZ82MP_$~)6mp3o^?fq4m{61;p)%4u5iQe5;==K0j!-e|Ri#0BWg0`^T zZ)S`|7Zv%W_f`G`8oy+u`03-&t*l^Kc?oY}`vrhk)Y?@8h1=TmC-U90tlr)}V}5Gm z`)r1;mMmCTC~{|=0p3sBpWwo>5Nmaz0i+Hs5o+yW5W+Ac|JG9KH_h*F{(TA b<=S4uzIAu2m_gHz;`RkBS;Nlrk2vxN5SNVE literal 0 HcmV?d00001 diff --git a/designer-realize/src/main/java/com/fr/start/Designer.java b/designer-realize/src/main/java/com/fr/start/Designer.java index fb974da98..1f8d181ce 100644 --- a/designer-realize/src/main/java/com/fr/start/Designer.java +++ b/designer-realize/src/main/java/com/fr/start/Designer.java @@ -1,5 +1,6 @@ package com.fr.start; +import com.fr.design.os.impl.SupportOSImpl; import com.fr.log.FineLoggerFactory; /** @@ -14,7 +15,8 @@ public class Designer { public static void main(String[] args) { try { - if (DesignerJavaRuntime.getInstance().isInValidVmOptions()) { + if (DesignerJavaRuntime.getInstance().isInValidVmOptions() + || SupportOSImpl.NON_GUARDIAN_START.support()) { runNonGuardianDesigner(args); } else { // 创建进程 diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index c264e79cb..ed7553620 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -1,12 +1,18 @@ package com.fr.start; +import com.fr.design.os.impl.SupportOSImpl; import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; import com.fr.process.engine.core.AbstractJavaRuntime; +import com.fr.stable.ArrayUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.os.OperatingSystem; -import java.util.Set; +import javax.imageio.ImageIO; +import java.io.File; +import java.io.IOException; + /** * 设计器Java运行环境 @@ -23,8 +29,20 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { private static final String JAVA_EXEC = "java"; 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 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=" + StableUtils.pathJoin(StableUtils.getInstallHome(), "bin", "logo.png"); 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(); public static DesignerJavaRuntime getInstance() { @@ -79,7 +97,11 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { @Override public String[] getJvmOptions() { if (isInstallVersion()) { - return super.getJvmOptions(); + String[] options = super.getJvmOptions(); + if (SupportOSImpl.DOCK_ICON.support()) { + options = ArrayUtils.add(options, DOCK_OPTIONS); + } + return options; } else { return DEBUG_OPTIONS; } From a4584870bd2fa7b88e18d18c7233ffbd7e341208 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 25 Mar 2020 19:52:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-28186=20mac=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E7=9F=AD=E6=9A=82=E5=8E=9F=E7=94=9Fjava=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/DesignerJavaRuntime.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java index ed7553620..6b0c45eab 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -31,7 +31,7 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { 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=" + StableUtils.pathJoin(StableUtils.getInstallHome(), "bin", "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"}; static {