From 34c0ea17897f1cfe0f11cd3451cf378ba0eb4a81 Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Thu, 29 Jun 2017 19:16:50 +0800 Subject: [PATCH 1/5] =?UTF-8?q?PFC-607=20=E6=8F=92=E4=BB=B6=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=88=A0=E9=99=A4=E6=9B=B4=E6=96=B0=E4=B8=8D=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E6=94=AF=E6=8C=81=20=E4=BF=AE=E5=A4=8D=E5=B7=B2?= =?UTF-8?q?=E5=8F=91=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DesignerFrameFileDealerPane.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 60f5067f11..94cccc14ed 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -27,7 +27,13 @@ import com.fr.file.FILE; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralContext; import com.fr.general.Inter; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.injectable.PluginModule; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.stable.project.ProjectConstants; @@ -60,7 +66,25 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt private OpenFolderAction openFolderAction = new OpenFolderAction(); private RenameAction renameAction = new RenameAction(); private DelFileAction delFileAction = new DelFileAction(); - + + static { + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + + @Override + public void on(PluginEvent event) { + + THIS.refreshDockingView(); + } + }, new PluginFilter() { + + @Override + public boolean accept(PluginContext context) { + + return context.contain(PluginModule.ExtraDesign, ShortCut.TEMPLATE_TREE); + } + }); + } + /** * 刷新 */ From c61a8370869dce5e55e20ec240d003b3a2279f70 Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Fri, 30 Jun 2017 12:14:58 +0800 Subject: [PATCH 2/5] =?UTF-8?q?PFC-607=20=E6=8F=92=E4=BB=B6=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=88=A0=E9=99=A4=E6=9B=B4=E6=96=B0=E4=B8=8D=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E6=94=AF=E6=8C=81=201=E3=80=81=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=202=E3=80=81=E5=A4=8D=E7=94=A8=E4=B9=8B=E5=89=8D=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E7=8E=AF=E5=A2=83=E6=97=B6=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9A=84=E4=BB=A3=E7=A0=81=EF=BC=8C=E6=AF=8F?= =?UTF-8?q?=E6=AC=A1=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=8F=92=E4=BB=B6=E5=8F=98?= =?UTF-8?q?=E5=8A=A8=E6=97=B6=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/CellElementPropertyPane.java | 41 ++--------------- .../data/datapane/TableDataTreePane.java | 5 +- .../tabledata/wrapper/TableDataFactory.java | 42 ++++++++--------- .../fr/design/mainframe/DesignerFrame.java | 46 +++++++++++++------ .../DesignerFrameFileDealerPane.java | 23 ---------- .../mainframe/WestRegionContainerPane.java | 6 +-- .../com/fr/design/mainframe/FormParaPane.java | 25 ---------- .../design/mainframe/FormParaWidgetPane.java | 27 ----------- 8 files changed, 61 insertions(+), 154 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java index 27e7e22ced..b1fa76b8d3 100644 --- a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java @@ -3,35 +3,22 @@ */ package com.fr.design.mainframe; -import java.awt.BorderLayout; -import java.awt.Dimension; - -import javax.swing.BorderFactory; -import javax.swing.Icon; -import javax.swing.JPanel; -import javax.swing.SwingConstants; - import com.fr.base.BaseUtils; -import com.fr.design.fun.CellAttributeProvider; -import com.fr.design.fun.PresentKindProvider; import com.fr.design.gui.frpane.UITitlePanel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itabpane.TitleChangeListener; import com.fr.design.mainframe.cell.CellElementEditPane; -import com.fr.general.GeneralContext; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; -import com.fr.plugin.context.PluginContext; -import com.fr.plugin.injectable.PluginModule; -import com.fr.plugin.manage.PluginFilter; -import com.fr.plugin.observer.PluginEvent; -import com.fr.plugin.observer.PluginEventListener; import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.Elem; import com.fr.report.elementcase.TemplateElementCase; +import javax.swing.*; +import java.awt.*; + /** * 所有组件一次全部加载,不存在延迟加载。 原因:设计器打开第一张模板的时候,会初始化许多许多东西。这个过程需要很长时间(快的3-5s)。 @@ -43,28 +30,6 @@ import com.fr.report.elementcase.TemplateElementCase; */ public class CellElementPropertyPane extends DockingView { - static { - GeneralContext.listenPluginRunningChanged(new PluginEventListener() { - - @Override - public void on(PluginEvent event) { - - synchronized (CellElementPropertyPane.class) { - singleton = new CellElementPropertyPane(); - } - } - }, new PluginFilter() { - - @Override - public boolean accept(PluginContext context) { - - return context.contain(PluginModule.ExtraDesign, PresentKindProvider.MARK_STRING) || - context.contain(PluginModule.ExtraDesign, CellAttributeProvider.MARK_STRING); - } - }); - } - - public synchronized static CellElementPropertyPane getInstance() { if (singleton == null) { singleton = new CellElementPropertyPane(); diff --git a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java index 1507d77b5a..a781497ebc 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java @@ -14,7 +14,6 @@ import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.fun.TableDataDefineProvider; import com.fr.design.fun.TableDataPaneProcessor; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.icontainer.UIScrollPane; @@ -100,8 +99,8 @@ public class TableDataTreePane extends BasicTableDataTreePane { @Override public boolean accept(PluginContext context) { - - return context.contain(PluginModule.ExtraDesign, TableDataDefineProvider.XML_TAG); + + return context.contain(PluginModule.ExtraDesign); } }); diff --git a/designer_base/src/com/fr/design/data/tabledata/wrapper/TableDataFactory.java b/designer_base/src/com/fr/design/data/tabledata/wrapper/TableDataFactory.java index ca118df761..ae74667532 100644 --- a/designer_base/src/com/fr/design/data/tabledata/wrapper/TableDataFactory.java +++ b/designer_base/src/com/fr/design/data/tabledata/wrapper/TableDataFactory.java @@ -26,23 +26,24 @@ public abstract class TableDataFactory { /** * 有顺序的,用来排序用 */ - private static Map map = new java.util.LinkedHashMap(); + private static Map map = new java.util.LinkedHashMap<>(); - private static Map extraMap = new LinkedHashMap<>(); + private static Map defaultMap = new LinkedHashMap<>(); /** * 同一类型的只能加一次,就加最上层的类,因为要排序。如果将所有的 FileTableData都加进来,那么FileTableData的排序就不正确了 */ static { - map.put(DBTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/database.png", DBTableData.class, DBTableDataPane.class)); - map.put(ClassTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/source/classTableData.png", ClassTableData.class, ClassTableDataPane.class)); - map.put(EmbeddedTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/dataTable.png", EmbeddedTableData.class, EmbeddedTableDataPane.class)); - map.put(DecoratedTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/multi.png", DecoratedTableData.class, DecoratedTableDataPane.class)); - map.put(StoreProcedure.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/store_procedure.png", StoreProcedure.class, ProcedureDataPane.class)); - map.put(MultiTDTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/multi.png", MultiTDTableData.class, MultiTDTableDataPane.class)); - map.put(FileTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/file.png", FileTableData.class, FileTableDataPane.class)); - map.put(RecursionTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/tree.png", RecursionTableData.class, TreeTableDataPane.class)); - map.put(MultiFieldTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/database.png", MultiFieldTableData.class, null)); + defaultMap.put(DBTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/database.png", DBTableData.class, DBTableDataPane.class)); + defaultMap.put(ClassTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/source/classTableData.png", ClassTableData.class, ClassTableDataPane.class)); + defaultMap.put(EmbeddedTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/dataTable.png", EmbeddedTableData.class, EmbeddedTableDataPane.class)); + defaultMap.put(DecoratedTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/multi.png", DecoratedTableData.class, DecoratedTableDataPane.class)); + defaultMap.put(StoreProcedure.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/store_procedure.png", StoreProcedure.class, ProcedureDataPane.class)); + defaultMap.put(MultiTDTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/multi.png", MultiTDTableData.class, MultiTDTableDataPane.class)); + defaultMap.put(FileTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/file.png", FileTableData.class, FileTableDataPane.class)); + defaultMap.put(RecursionTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/tree.png", RecursionTableData.class, TreeTableDataPane.class)); + defaultMap.put(MultiFieldTableData.class.getName(), new TableDataNameObjectCreator(null, "/com/fr/design/images/data/database.png", MultiFieldTableData.class, null)); + map.putAll(defaultMap); } /** @@ -53,24 +54,20 @@ public abstract class TableDataFactory { */ public static void registerExtra(Class clazz, TableDataNameObjectCreator creator) { - extraMap.put(clazz.getName(), creator); + map.put(clazz.getName(), creator); } public static void removeExtra(Class clazz) { - - extraMap.remove(clazz.getName()); - } - private static TableDataNameObjectCreator getTableDataNameObjectCreator(TableData tabledata) { - - TableDataNameObjectCreator creator = getFrom(tabledata, extraMap); - if (creator == null) { - creator = getFrom(tabledata, map); + String name = clazz.getName(); + if (defaultMap.containsKey(name)) { + map.put(name, defaultMap.get(name)); + } else { + map.remove(name); } - return creator; } - private static TableDataNameObjectCreator getFrom(TableData tabledata, Map map) { + private static TableDataNameObjectCreator getTableDataNameObjectCreator(TableData tabledata) { TableDataNameObjectCreator tableDataNameObjectCreator = map.get(tabledata.getClass().getName()); if (tableDataNameObjectCreator == null) { @@ -83,6 +80,7 @@ public abstract class TableDataFactory { return tableDataNameObjectCreator; } + /** * 获取数据集所对应的编辑面板 * diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java index 717674f223..f48b19e1d5 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java +++ b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java @@ -37,6 +37,7 @@ import com.fr.general.FRLogger; import com.fr.general.GeneralContext; import com.fr.general.Inter; import com.fr.plugin.context.PluginContext; +import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; @@ -662,19 +663,38 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta GUICoreUtils.setWindowFullScreen(this); } } - - /** - * 报表运行环境改变时,需要刷新某些面板 - * - * @param env - * 环境 - */ - public void refreshEnv(Env env) { - this.setTitle(); - DesignerFrameFileDealerPane.getInstance().refreshDockingView(); - TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); - TemplateTreePane.getInstance().refreshDockingView(); - DesignTableDataManager.clearGlobalDs(); + + { + 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 env 环境 + */ + public void refreshEnv(Env env) { + + this.setTitle(); + DesignerFrameFileDealerPane.getInstance().refreshDockingView(); + TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()); + TemplateTreePane.getInstance().refreshDockingView(); + DesignTableDataManager.clearGlobalDs(); EastRegionContainerPane.getInstance().refreshDownPane(); } diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 94cccc14ed..89901ac540 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -27,13 +27,7 @@ import com.fr.file.FILE; import com.fr.file.FileNodeFILE; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; -import com.fr.general.GeneralContext; import com.fr.general.Inter; -import com.fr.plugin.context.PluginContext; -import com.fr.plugin.injectable.PluginModule; -import com.fr.plugin.manage.PluginFilter; -import com.fr.plugin.observer.PluginEvent; -import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.CoreConstants; import com.fr.stable.StableUtils; import com.fr.stable.project.ProjectConstants; @@ -67,23 +61,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt private RenameAction renameAction = new RenameAction(); private DelFileAction delFileAction = new DelFileAction(); - static { - GeneralContext.listenPluginRunningChanged(new PluginEventListener() { - - @Override - public void on(PluginEvent event) { - - THIS.refreshDockingView(); - } - }, new PluginFilter() { - - @Override - public boolean accept(PluginContext context) { - - return context.contain(PluginModule.ExtraDesign, ShortCut.TEMPLATE_TREE); - } - }); - } /** * 刷新 diff --git a/designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java b/designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java index e2a6d64d53..f0b646808a 100644 --- a/designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java +++ b/designer_base/src/com/fr/design/mainframe/WestRegionContainerPane.java @@ -3,10 +3,10 @@ package com.fr.design.mainframe; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.data.datapane.TableDataTreePane; -import com.fr.design.fun.TableDataPaneProcessor; import com.fr.design.gui.icontainer.UIResizableContainer; import com.fr.general.GeneralContext; import com.fr.plugin.context.PluginContext; +import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; @@ -45,8 +45,8 @@ public class WestRegionContainerPane extends UIResizableContainer { @Override public boolean accept(PluginContext context) { - - return context.contain(TableDataPaneProcessor.XML_TAG); + + return context.contain(PluginModule.ExtraDesign); } }); diff --git a/designer_form/src/com/fr/design/mainframe/FormParaPane.java b/designer_form/src/com/fr/design/mainframe/FormParaPane.java index 732d5632ec..755deec3b0 100644 --- a/designer_form/src/com/fr/design/mainframe/FormParaPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormParaPane.java @@ -3,20 +3,13 @@ package com.fr.design.mainframe; import com.fr.design.ExtraDesignClassManager; import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreatorUtils; -import com.fr.design.fun.CellWidgetOptionProvider; import com.fr.design.gui.core.UserDefinedWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.*; -import com.fr.general.GeneralContext; import com.fr.general.Inter; -import com.fr.plugin.context.PluginContext; -import com.fr.plugin.injectable.PluginModule; -import com.fr.plugin.manage.PluginFilter; -import com.fr.plugin.observer.PluginEvent; -import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.ArrayUtils; import javax.swing.*; @@ -50,24 +43,6 @@ public class FormParaPane extends JPanel { private FormDesigner designer; - static { - GeneralContext.listenPluginRunningChanged(new PluginEventListener() { - - @Override - public void on(PluginEvent event) { - - THIS = null; - } - }, new PluginFilter() { - - @Override - public boolean accept(PluginContext context) { - - return context.contain(PluginModule.ExtraDesign, CellWidgetOptionProvider.XML_TAG); - } - }); - } - public static final FormParaPane getInstance(FormDesigner designer) { if(THIS == null) { THIS = new FormParaPane(); diff --git a/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java b/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java index c3855c3c9c..10d90d4cad 100644 --- a/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java @@ -6,7 +6,6 @@ import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreatorUtils; -import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.gui.core.FormWidgetOption; import com.fr.design.gui.core.UserDefinedWidgetOption; import com.fr.design.gui.core.WidgetOption; @@ -17,13 +16,7 @@ import com.fr.design.module.DesignModuleFactory; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.*; import com.fr.general.ComparatorUtils; -import com.fr.general.GeneralContext; import com.fr.general.Inter; -import com.fr.plugin.context.PluginContext; -import com.fr.plugin.injectable.PluginModule; -import com.fr.plugin.manage.PluginFilter; -import com.fr.plugin.observer.PluginEvent; -import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.ArrayUtils; import javax.swing.*; @@ -63,26 +56,6 @@ public class FormParaWidgetPane extends JPanel { private FormDesigner designer; - static { - GeneralContext.listenPluginRunningChanged(new PluginEventListener() { - - @Override - public void on(PluginEvent event) { - - synchronized (FormParaWidgetPane.class) { - THIS = null; - } - } - }, new PluginFilter() { - - @Override - public boolean accept(PluginContext context) { - - return context.contain(PluginModule.ExtraDesign, FormWidgetOptionProvider.XML_TAG); - } - }); - } - public static synchronized final FormParaWidgetPane getInstance(FormDesigner designer) { if (THIS == null) { THIS = new FormParaWidgetPane(); 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 3/5] =?UTF-8?q?PFC-607=20=E6=8F=92=E4=BB=B6=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=88=A0=E9=99=A4=E6=9B=B4=E6=96=B0=E4=B8=8D=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E6=94=AF=E6=8C=81=201=E3=80=81=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=202=E3=80=81=E5=A4=8D=E7=94=A8=E4=B9=8B=E5=89=8D=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E7=8E=AF=E5=A2=83=E6=97=B6=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9A=84=E4=BB=A3=E7=A0=81=EF=BC=8C=E6=AF=8F?= =?UTF-8?q?=E6=AC=A1=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=8F=92=E4=BB=B6=E5=8F=98?= =?UTF-8?q?=E5=8A=A8=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 f48b19e1d5..7b2f9a9d36 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 8ed8aa6175..82a8f6b535 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, 把一切放到这个里面.可以让多个地方调用. */ From bfe28f0bde1c69968873144cfeee4bb78c2eeeda Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Fri, 30 Jun 2017 13:59:37 +0800 Subject: [PATCH 4/5] =?UTF-8?q?PFC-607=20=E6=8F=92=E4=BB=B6=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=88=A0=E9=99=A4=E6=9B=B4=E6=96=B0=E4=B8=8D=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E6=94=AF=E6=8C=81=201=E3=80=81=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=202=E3=80=81=E5=A4=8D=E7=94=A8=E4=B9=8B=E5=89=8D=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E7=8E=AF=E5=A2=83=E6=97=B6=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9A=84=E4=BB=A3=E7=A0=81=EF=BC=8C=E6=AF=8F?= =?UTF-8?q?=E6=AC=A1=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=8F=92=E4=BB=B6=E5=8F=98?= =?UTF-8?q?=E5=8A=A8=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 | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java index 7b2f9a9d36..737fdcab27 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java +++ b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java @@ -174,26 +174,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta this.resetToolkitByPlus(null); } - - { - 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 From db6d3f36f81f3827f9058cfb5812dd9fb36debc6 Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Fri, 30 Jun 2017 15:00:02 +0800 Subject: [PATCH 5/5] =?UTF-8?q?PFC-607=20=E6=8F=92=E4=BB=B6=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=88=A0=E9=99=A4=E6=9B=B4=E6=96=B0=E4=B8=8D=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E6=94=AF=E6=8C=81=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/CellElementPropertyPane.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java index b1fa76b8d3..55235c5c98 100644 --- a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java @@ -8,10 +8,16 @@ import com.fr.design.gui.frpane.UITitlePanel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itabpane.TitleChangeListener; import com.fr.design.mainframe.cell.CellElementEditPane; +import com.fr.general.GeneralContext; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.injectable.PluginModule; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.Elem; import com.fr.report.elementcase.TemplateElementCase; @@ -30,6 +36,26 @@ import java.awt.*; */ public class CellElementPropertyPane extends DockingView { + static { + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + + @Override + public void on(PluginEvent event) { + + synchronized (CellElementPropertyPane.class) { + singleton = null; + } + } + }, new PluginFilter() { + + @Override + public boolean accept(PluginContext context) { + + return context.contain(PluginModule.ExtraDesign); + } + }); + } + public synchronized static CellElementPropertyPane getInstance() { if (singleton == null) { singleton = new CellElementPropertyPane();