From 694b6e266aaf87d8b49a15e6b5066db5d0168c1b Mon Sep 17 00:00:00 2001 From: zheng Date: Sat, 23 Jun 2018 17:00:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?CHART-2426=20=E6=B3=A8=E5=86=8C=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/core/ActionFactory.java | 25 ++----------------- .../com/fr/design/module/DesignerModule.java | 7 +++--- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/designer-base/src/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/com/fr/design/actions/core/ActionFactory.java index 00824285c6..036b82a32c 100644 --- a/designer-base/src/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/com/fr/design/actions/core/ActionFactory.java @@ -9,7 +9,8 @@ import com.fr.design.menu.MenuKeySet; import com.fr.design.selection.QuickEditor; import com.fr.log.FineLoggerFactory; -import javax.swing.*; +import javax.swing.Action; +import javax.swing.KeyStroke; import java.awt.event.KeyEvent; import java.lang.reflect.Constructor; import java.util.ArrayList; @@ -139,28 +140,6 @@ public class ActionFactory { chartPreStyleAction = action; } - /** - * kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollection和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. - * - * @param editorClass 悬浮元素图表编辑器类 - */ - public static void registerChartFloatEditorInEditor(Class editorClass) { - if (chartCollectionClass != null) { - registerFloatEditorClass(chartCollectionClass, editorClass); - } - } - - /** - * kunsnat: 图表注册 单元格元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. - * - * @param editorClass 单元格元素图表编辑器类 - */ - public static void registerChartCellEditorInEditor(Class editorClass) { - if (chartCollectionClass != null) { - registerCellEditorClass(chartCollectionClass, editorClass); - } - } - /** * 图表预定义样式Action * diff --git a/designer-realize/src/com/fr/design/module/DesignerModule.java b/designer-realize/src/com/fr/design/module/DesignerModule.java index 5b95d034fc..0b88782a25 100644 --- a/designer-realize/src/com/fr/design/module/DesignerModule.java +++ b/designer-realize/src/com/fr/design/module/DesignerModule.java @@ -13,6 +13,7 @@ import com.fr.base.frpx.exception.InvalidWorkBookException; import com.fr.base.io.XMLEncryptUtils; import com.fr.base.process.ProcessOperator; import com.fr.base.remote.RemoteDeziConstants; +import com.fr.chart.chartattr.ChartCollection; import com.fr.config.ServerPreferenceConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -49,13 +50,13 @@ import com.fr.design.parameter.WorkBookParameterReader; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.FILE; import com.fr.general.ComparatorUtils; -import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.ModuleContext; import com.fr.general.xml.GeneralXMLTools; import com.fr.io.importer.Excel2007ReportImporter; import com.fr.io.importer.ExcelReportImporter; import com.fr.io.utils.ResourceIOUtils; +import com.fr.log.FineLoggerFactory; import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBookAdapter; import com.fr.main.impl.WorkBookX; @@ -161,7 +162,7 @@ public class DesignerModule extends DesignModule { ActionFactory.registerCellEditor(BufferedImage.class, new CellImageQuickEditor()); ActionFactory.registerCellEditor(CellImagePainter.class, new CellImageQuickEditor()); //todo 图表编辑器populate没能实现刷新面板显示 - ActionFactory.registerChartCellEditorInEditor(BasicChartQuickEditor.class); + ActionFactory.registerCellEditorClass(ChartCollection.class, BasicChartQuickEditor.class); Set providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); for (ElementUIProvider provider : providers) { @@ -191,7 +192,7 @@ public class DesignerModule extends DesignModule { ActionFactory.registerFloatEditor(BufferedImage.class, new FloatImageQuickEditor()); ActionFactory.registerFloatEditor(CellImagePainter.class, new FloatImageQuickEditor()); //todo 图表编辑器populate没能实现刷新面板显示 - ActionFactory.registerChartFloatEditorInEditor(FloatChartQuickEditor.class); + ActionFactory.registerFloatEditorClass(ChartCollection.class, FloatChartQuickEditor.class); } /** From 4f20da587e7dfa481149d14e142f76f03ee41f88 Mon Sep 17 00:00:00 2001 From: zheng Date: Mon, 25 Jun 2018 09:15:45 +0800 Subject: [PATCH 2/2] update --- .../com/fr/design/module/DesignerModule.java | 20 ++++++++++--------- .../start/module/DesignerModuleActivator.java | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/designer-realize/src/com/fr/design/module/DesignerModule.java b/designer-realize/src/com/fr/design/module/DesignerModule.java index 0b88782a25..08df15c2ca 100644 --- a/designer-realize/src/com/fr/design/module/DesignerModule.java +++ b/designer-realize/src/com/fr/design/module/DesignerModule.java @@ -131,25 +131,27 @@ public class DesignerModule extends DesignModule { GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); addAdapterForPlate(); - registerCellEditor(); - registerFloatEditor(); - registerData4Form(); - registerOtherPane(); - InformationCollector.getInstance().collectStartTime(); ExtraDesignClassManager.getInstance().getFeedback().didFeedback(); StableFactory.registerMarkedObject(LogProvider.MARK_STRING, DesignerLogImpl.getInstance()); } - private void registerOtherPane() { + public static void register() { + registerCellEditor(); + registerFloatEditor(); + registerData4Form(); + registerOtherPane(); + } + + private static void registerOtherPane() { StableFactory.registerMarkedClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPane.class); } /** * kunsnat:注册单元格选中Editor */ - private void registerCellEditor() { + private static void registerCellEditor() { ActionFactory.registerCellEditor(String.class, new CellStringQuickEditor()); ActionFactory.registerCellEditor(Number.class, new CellStringQuickEditor()); @@ -184,7 +186,7 @@ public class DesignerModule extends DesignModule { /** * kunnat: 注册悬浮选中Editor */ - private void registerFloatEditor() { + private static void registerFloatEditor() { ActionFactory.registerFloatEditor(String.class, new FloatStringQuickEditor()); ActionFactory.registerFloatEditor(Formula.class, new FloatStringQuickEditor()); @@ -494,7 +496,7 @@ public class DesignerModule extends DesignModule { } - private void registerData4Form() { + private static void registerData4Form() { StableFactory.registerMarkedClass(FormECDesignerProvider.XML_TAG, FormElementCaseDesigner.class); StableFactory.registerMarkedClass(FormECCompositeProvider.XML_TAG, FormReportComponentComposite.class); DesignModuleFactory.registerParameterReader(new WorkBookParameterReader()); diff --git a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java index 08c488df23..e6b0e1ab0a 100644 --- a/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java +++ b/designer-realize/src/com/fr/start/module/DesignerModuleActivator.java @@ -19,6 +19,7 @@ public class DesignerModuleActivator extends Activator implements Prepare { ModuleContext.startModule(DesignerModule.class.getName()); + DesignerModule.register(); ChartDesignerModule.register(); }