From c3090829296a615b789c15af320fd24465e1a278 Mon Sep 17 00:00:00 2001 From: vito Date: Mon, 23 Sep 2019 18:13:38 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-22207=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E4=B8=BB=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/start/BaseDesigner.java | 22 ++++++++++++------- .../java/com/fr/start/server/ServerTray.java | 12 ++++++++-- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/start/BaseDesigner.java b/designer-base/src/main/java/com/fr/start/BaseDesigner.java index 70399a2ac..37c668971 100644 --- a/designer-base/src/main/java/com/fr/start/BaseDesigner.java +++ b/designer-base/src/main/java/com/fr/start/BaseDesigner.java @@ -46,6 +46,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock { } private void init() { + prepare(); // 初始化look and feel.这个在预加载之前执行是因为lookAndFeel里的东西,预加载时也要用到 DesignUtils.initLookAndFeel(); // 初始化Log Handler @@ -53,14 +54,10 @@ public abstract class BaseDesigner extends ToolBarMenuDock { createDesignerFrame(); } - public void show() { - UIUtil.invokeLaterIfNeeded(new Runnable() { - @Override - public void run() { - refreshTemplateTree(); - } - }); - + /** + * 准备一些订阅 + */ + private void prepare() { EventDispatcher.listen(DesignerLaunchStatus.DESIGNER_INIT_COMPLETE, new Listener() { @Override public void on(Event event, Null param) { @@ -83,6 +80,15 @@ public abstract class BaseDesigner extends ToolBarMenuDock { }); } + public void show() { + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + refreshTemplateTree(); + } + }); + } + private void refreshTemplateTree() { //TODO: 2019-06-14 这里有啥作用? DesignerContext.getDesignerFrame().refreshEnv(); diff --git a/designer-base/src/main/java/com/fr/start/server/ServerTray.java b/designer-base/src/main/java/com/fr/start/server/ServerTray.java index f6dede295..2b3713c0f 100644 --- a/designer-base/src/main/java/com/fr/start/server/ServerTray.java +++ b/designer-base/src/main/java/com/fr/start/server/ServerTray.java @@ -1,6 +1,7 @@ package com.fr.start.server; import com.fr.base.BaseUtils; +import com.fr.design.ui.util.UIUtil; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.ListenerAdaptor; @@ -85,6 +86,7 @@ public class ServerTray { //创建退出菜单监听器 ActionListener exitListener = new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { exit(); @@ -177,7 +179,13 @@ public class ServerTray { } public static void init() { - if (INSTANCE == null) - INSTANCE = new ServerTray(); + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + if (INSTANCE == null) { + INSTANCE = new ServerTray(); + } + } + }); } } \ No newline at end of file