From f1b45a27e8554cc52985a67a1dd1581be15f6860 Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Fri, 30 Jun 2017 12:19:14 +0800 Subject: [PATCH] =?UTF-8?q?PFC-607=20=E6=8F=92=E4=BB=B6=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=9B=B4=E6=96=B0=E4=B8=8D=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E6=94=AF=E6=8C=81=201=E3=80=81=E4=BF=AE=E5=A4=8Dbug=202?= =?UTF-8?q?=E3=80=81=E5=A4=8D=E7=94=A8=E4=B9=8B=E5=89=8D=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=97=B6=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=9A=84=E4=BB=A3=E7=A0=81=EF=BC=8C=E6=AF=8F=E6=AC=A1?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=8F=92=E4=BB=B6=E5=8F=98=E5=8A=A8?= =?UTF-8?q?=E6=97=B6=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrame.java | 62 ++++++++++--------- .../src/com/fr/design/utils/DesignUtils.java | 19 +++--- 2 files changed, 45 insertions(+), 36 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java index f48b19e1d..7b2f9a9d3 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java +++ b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java @@ -27,6 +27,7 @@ import com.fr.design.mainframe.loghandler.LogMessageBar; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.menu.MenuManager; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.FILE; import com.fr.file.FILEFactory; @@ -172,15 +173,35 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta basePane.add(menuPane, BorderLayout.NORTH); this.resetToolkitByPlus(null); } - - /** - * @param ad - * @return - */ - protected JPanel initNorthEastPane(final ToolBarMenuDock ad){ - //hugh: private修改为protected方便oem的时候修改右上的组件构成 - //顶部日志+登陆按钮 - final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + + { + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + + @Override + public void on(PluginEvent event) { + + DesignerContext.getDesignerFrame().refreshEnv(FRContext.getCurrentEnv()); + DesignerContext.getDesignerFrame().repaint(); + } + }, new PluginFilter() { + + @Override + public boolean accept(PluginContext context) { + + return context.contain(PluginModule.ExtraDesign); + } + }); + } + + /** + * @param ad + * @return + */ + protected JPanel initNorthEastPane(final ToolBarMenuDock ad) { + //hugh: private修改为protected方便oem的时候修改右上的组件构成 + //顶部日志+登陆按钮 + final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); GeneralContext.listenPluginRunningChanged(new PluginEventListener() { @@ -188,13 +209,14 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta public void on(PluginEvent event) { refreshNorthEastPane(northEastPane, ad); + DesignUtils.refreshDesignerFrame(FRContext.getCurrentEnv()); } }, new PluginFilter() { @Override public boolean accept(PluginContext context) { - - return context.contain(TitlePlaceProcessor.MARK_STRING); + + return context.contain(PluginModule.ExtraDesign); } }); refreshNorthEastPane(northEastPane, ad); @@ -664,24 +686,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } - { - GeneralContext.listenPluginRunningChanged(new PluginEventListener() { - - @Override - public void on(PluginEvent event) { - - DesignerContext.getDesignerFrame().refreshEnv(FRContext.getCurrentEnv()); - DesignerContext.getDesignerFrame().repaint(); - } - }, new PluginFilter() { - - @Override - public boolean accept(PluginContext context) { - - return context.contain(PluginModule.ExtraDesign); - } - }); - } /** * 报表运行环境改变时,需要刷新某些面板 diff --git a/designer_base/src/com/fr/design/utils/DesignUtils.java b/designer_base/src/com/fr/design/utils/DesignUtils.java index 8ed8aa617..82a8f6b53 100644 --- a/designer_base/src/com/fr/design/utils/DesignUtils.java +++ b/designer_base/src/com/fr/design/utils/DesignUtils.java @@ -181,9 +181,18 @@ public class DesignUtils { // 更新CurrentEnv于FRContext & DesignerEnvManager FRContext.setCurrentEnv(env); - + + refreshDesignerFrame(env); + // 当换了运行环境,重置服务器,让它下次预览时重启 + if (env instanceof LocalEnv && !ComparatorUtils.equals(env.getPath(), oldEnvPath)) { + StartServer.currentEnvChanged(); + } + } + + public static void refreshDesignerFrame(Env env) { + final Env run_env = env; - + // 刷新DesignerFrame里面的面板 SwingUtilities.invokeLater(new Runnable() { @@ -195,12 +204,8 @@ public class DesignUtils { DesignerContext.getDesignerFrame().repaint();// kunsnat: 切换环境后 刷新下 报表. 比如图表某些风格改变. } }); - // 当换了运行环境,重置服务器,让它下次预览时重启 - if (env instanceof LocalEnv && !ComparatorUtils.equals(env.getPath(), oldEnvPath)) { - StartServer.currentEnvChanged(); - } } - + /** * p:初始化look and feel, 把一切放到这个里面.可以让多个地方调用. */