From 2c56e5ca631c87468ac208fe91c3a6e776bfba04 Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 19 Jun 2018 20:46:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?CHART-2399=2010.0=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E4=B8=8D=E5=B8=A6=E7=94=A8envchange=20widgetoptions=E5=9C=A8ch?= =?UTF-8?q?artdesignermodule=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/ChartTypeInterfaceManager.java | 7 +------ .../src/com/fr/design/module/ChartDesignerModule.java | 8 ++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/com/fr/design/ChartTypeInterfaceManager.java index e28e2fcca..a2d06362a 100644 --- a/designer-chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -27,7 +27,6 @@ import com.fr.design.chartinterface.RangeIndependentChartInterface; import com.fr.design.chartinterface.StockIndependentChartInterface; import com.fr.design.chartinterface.XYScatterIndependentChartInterface; import com.fr.design.condition.ConditionAttributesPane; -import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.AbstractChartAttrPane; @@ -60,7 +59,6 @@ import com.fr.plugin.chart.radar.VanChartRadarPlot; import com.fr.plugin.chart.scatter.VanChartScatterPlot; import com.fr.plugin.chart.structure.VanChartStructurePlot; import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; -import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginSingleInjection; @@ -69,7 +67,6 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.EnvChangedListener; import com.fr.stable.StringUtils; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; -import com.fr.van.chart.DownloadOnlineSourcesHelper; import com.fr.van.chart.area.AreaIndependentVanChartInterface; import com.fr.van.chart.bar.BarIndependentVanChartInterface; import com.fr.van.chart.bubble.BubbleIndependentVanChartInterface; @@ -133,13 +130,11 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr public void envChanged() { //重新注册designModuleFactory DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption()); - DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance()); - DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); } }); } - private static WidgetOption[] initWidgetOption() { + public static WidgetOption[] initWidgetOption() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; diff --git a/designer-chart/src/com/fr/design/module/ChartDesignerModule.java b/designer-chart/src/com/fr/design/module/ChartDesignerModule.java index 52f5ae080..da825abc5 100644 --- a/designer-chart/src/com/fr/design/module/ChartDesignerModule.java +++ b/designer-chart/src/com/fr/design/module/ChartDesignerModule.java @@ -9,15 +9,18 @@ import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.ChartDialog; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartWidgetOption; +import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.core.WidgetOption; import com.fr.design.mainframe.App; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.IOUtils; import com.fr.general.Inter; +import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent; import com.fr.stable.ArrayUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; +import com.fr.van.chart.DownloadOnlineSourcesHelper; import com.fr.van.chart.map.server.ChartMapEditorAction; import javax.swing.Icon; @@ -54,6 +57,11 @@ public class ChartDesignerModule extends DesignModule { ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction()); + + DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); + + DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance()); + DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); } protected void registerFloatEditor() { From e3ac9513f3a1dea27c3a43aa0f87161c3616fab2 Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 20 Jun 2018 15:20:45 +0800 Subject: [PATCH 2/2] module to activator --- .../fr/design/module/ChartDesignerModule.java | 16 +++------------- .../fr/start/module/DesignerModuleActivator.java | 3 +++ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/designer-chart/src/com/fr/design/module/ChartDesignerModule.java b/designer-chart/src/com/fr/design/module/ChartDesignerModule.java index da825abc5..3b086e275 100644 --- a/designer-chart/src/com/fr/design/module/ChartDesignerModule.java +++ b/designer-chart/src/com/fr/design/module/ChartDesignerModule.java @@ -33,19 +33,11 @@ import javax.swing.Icon; * Time: 上午9:13 */ public class ChartDesignerModule extends DesignModule { - public void start() { - super.start(); - dealBeforeRegister(); - register(); - registerFloatEditor(); - } - protected void dealBeforeRegister(){ + public static void register(){ StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class); - } - private void register(){ DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); DesignModuleFactory.registerChartEditorClass(ChartEditor.class); @@ -58,16 +50,14 @@ public class ChartDesignerModule extends DesignModule { ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction()); + ActionFactory.registerChartCollection(ChartCollection.class); + DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance()); DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper()); } - protected void registerFloatEditor() { - ActionFactory.registerChartCollection(ChartCollection.class); - } - /** * 返回设计器能打开的模板类型的一个数组列表 * diff --git a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java index 2855a45f4..fde57bb3a 100644 --- a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java +++ b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java @@ -1,6 +1,7 @@ package com.fr.start.module; import com.fr.design.mainframe.loghandler.socketio.DesignerSocketIO; +import com.fr.design.module.ChartDesignerModule; import com.fr.design.module.DesignerModule; import com.fr.general.ModuleContext; import com.fr.locale.InterMutableKey; @@ -19,6 +20,8 @@ public class DesignerModuleActivator extends Activator implements Prepare { ModuleContext.startModule(DesignerModule.class.getName()); DesignerSocketIO.init(); + + ChartDesignerModule.register(); } @Override