diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 2cf8d8c35..1b86b6239 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -60,6 +60,7 @@ import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.ProductConstants; +import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.image4j.codec.ico.ICODecoder; import com.fr.stable.os.OperatingSystem; @@ -72,6 +73,7 @@ import com.fr.workspace.Workspace; import com.fr.workspace.connect.WorkspaceConnectionInfo; import org.jetbrains.annotations.Nullable; +import javax.imageio.ImageIO; import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JFrame; @@ -176,6 +178,16 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta private int contentHeight = (int) (java.awt.Toolkit.getDefaultToolkit().getScreenSize().getHeight()); + static { + if (SupportOSImpl.DOCK_ICON.support()) { + try { + ImageIO.write(IOUtils.readImage("com/fr/design/icon/logo.png"), "png", new File( + StableUtils.pathJoin(StableUtils.getInstallHome(), "bin", "logo.png"))); + } catch (IOException ignore) { + } + } + } + private WindowAdapter windowAdapter = new WindowAdapter() { @Override 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 f75e07ea6..1a6e272a4 100644 --- a/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java +++ b/designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java @@ -32,18 +32,9 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime { 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 DOCK_NAME_OPTIONS = "-Xdock:name=" + FineDesigner.class.getName(); + private static final String DOCK_NAME_OPTIONS = "-Xdock:name=" + FineDesigner.class.getSimpleName(); 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() {