From 02fe3f7b1319a521737eca5b438f86a66795439f Mon Sep 17 00:00:00 2001 From: fr_shine Date: Fri, 11 Aug 2017 17:55:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/start/Designer.java | 3 + .../fr/design/actions/core/ActionFactory.java | 14 +++++ .../fr/design/module/ChartDesignerModule.java | 2 +- .../chart/map/server/MapMenuHandler.java | 61 ------------------- 4 files changed, 18 insertions(+), 62 deletions(-) delete mode 100644 designer_chart/src/com/fr/plugin/chart/map/server/MapMenuHandler.java diff --git a/designer/src/com/fr/start/Designer.java b/designer/src/com/fr/start/Designer.java index d4e92bf9cc..bd4c455e71 100644 --- a/designer/src/com/fr/start/Designer.java +++ b/designer/src/com/fr/start/Designer.java @@ -116,6 +116,9 @@ public class Designer extends BaseDesigner { if (ActionFactory.getChartPreStyleAction() != null) { menuDef.addShortCut(ActionFactory.getChartPreStyleAction()); } + if (ActionFactory.getChartMapEditorAction() != null) { + menuDef.addShortCut(ActionFactory.getChartMapEditorAction()); + } } insertMenu(menuDef, MenuHandler.SERVER); 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 b1e2f1a65e..01c0708992 100644 --- a/designer_base/src/com/fr/design/actions/core/ActionFactory.java +++ b/designer_base/src/com/fr/design/actions/core/ActionFactory.java @@ -32,6 +32,8 @@ public class ActionFactory { private static UpdateAction chartPreStyleAction = null; + private static UpdateAction chartMapEditorAction = null; + /** * 待说明 * @@ -69,6 +71,18 @@ public class ActionFactory { return chartPreStyleAction; } + /** + * 注册图表的 地图资源 + * @param action 地图资源action + */ + public static void registerChartMapEditorAction(UpdateAction action) { + chartMapEditorAction = action; + } + + public static UpdateAction getChartMapEditorAction() { + return chartMapEditorAction; + } + /** * kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. * diff --git a/designer_chart/src/com/fr/design/module/ChartDesignerModule.java b/designer_chart/src/com/fr/design/module/ChartDesignerModule.java index 979be5c92a..bd7bf3cbb5 100644 --- a/designer_chart/src/com/fr/design/module/ChartDesignerModule.java +++ b/designer_chart/src/com/fr/design/module/ChartDesignerModule.java @@ -1 +1 @@ -package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; 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.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.stable.ArrayUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import javax.swing.*; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-7-8 * Time: 上午9:13 */ public class ChartDesignerModule extends DesignModule { public void start() { super.start(); dealBeforeRegister(); register(); registerFloatEditor(); } protected void dealBeforeRegister(){ 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); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.class); DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); } protected void registerFloatEditor() { ActionFactory.registerChartCollection(ChartCollection.class); } /** * 返回设计器能打开的模板类型的一个数组列表 * * @return 可以打开的模板类型的数组 */ public App[] apps4TemplateOpener() { return new App[0]; } protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); if (ArrayUtils.isEmpty(rowChart)) { continue; } String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } } \ No newline at end of file +package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; 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.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.map.server.ChartMapEditorAction; import com.fr.stable.ArrayUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import javax.swing.*; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-7-8 * Time: 上午9:13 */ public class ChartDesignerModule extends DesignModule { public void start() { super.start(); dealBeforeRegister(); register(); registerFloatEditor(); } protected void dealBeforeRegister(){ 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); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.class); DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction()); } protected void registerFloatEditor() { ActionFactory.registerChartCollection(ChartCollection.class); } /** * 返回设计器能打开的模板类型的一个数组列表 * * @return 可以打开的模板类型的数组 */ public App[] apps4TemplateOpener() { return new App[0]; } protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); if (ArrayUtils.isEmpty(rowChart)) { continue; } String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } } \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/map/server/MapMenuHandler.java b/designer_chart/src/com/fr/plugin/chart/map/server/MapMenuHandler.java deleted file mode 100644 index 87108bb3dd..0000000000 --- a/designer_chart/src/com/fr/plugin/chart/map/server/MapMenuHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.fr.plugin.chart.map.server; - -import com.fr.design.fun.impl.AbstractMenuHandler; -import com.fr.design.menu.ShortCut; - -/** - * Created by Mitisky on 16/4/29. - */ -public class MapMenuHandler extends AbstractMenuHandler { - private static final int POSITION_OFFSET = 11; - - /** - * 插入菜单的位置 - * - * @param total 插入的位置 - * @return 插入位置,如果想放到最后,则返回-1 - */ - @Override - public int insertPosition(int total) { - return POSITION_OFFSET; - } - - /** - * 是否在插入的菜单前插入一个分割符 - * - * @return 是否插入分隔符 - */ - @Override - public boolean insertSeparatorBefore() { - return false; - } - - /** - * 是否在插入的菜单后插入一个分割符 - * - * @return 是否插入分隔符 - */ - @Override - public boolean insertSeparatorAfter() { - return false; - } - - /** - * 所属的分类菜单 - * - * @return 分类菜单名 - */ - @Override - public String category() { - return SERVER; - } - - /** - * 快捷方式 - * @return 生成一个实例 - */ - @Override - public ShortCut shortcut() { - return new ChartMapEditorAction(); - } -} From c35c9a8d34df07be3975d2d1e61947a2b480a7bc Mon Sep 17 00:00:00 2001 From: fr_shine Date: Fri, 11 Aug 2017 18:00:30 +0800 Subject: [PATCH 2/2] update --- .../fr/design/module/ChartDesignerModule.java | 93 ++++++++++++++++++- 1 file changed, 92 insertions(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/module/ChartDesignerModule.java b/designer_chart/src/com/fr/design/module/ChartDesignerModule.java index bd7bf3cbb5..586910774a 100644 --- a/designer_chart/src/com/fr/design/module/ChartDesignerModule.java +++ b/designer_chart/src/com/fr/design/module/ChartDesignerModule.java @@ -1 +1,92 @@ -package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; 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.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.map.server.ChartMapEditorAction; import com.fr.stable.ArrayUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import javax.swing.*; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-7-8 * Time: 上午9:13 */ public class ChartDesignerModule extends DesignModule { public void start() { super.start(); dealBeforeRegister(); register(); registerFloatEditor(); } protected void dealBeforeRegister(){ 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); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.class); DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction()); } protected void registerFloatEditor() { ActionFactory.registerChartCollection(ChartCollection.class); } /** * 返回设计器能打开的模板类型的一个数组列表 * * @return 可以打开的模板类型的数组 */ public App[] apps4TemplateOpener() { return new App[0]; } protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); if (ArrayUtils.isEmpty(rowChart)) { continue; } String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } } \ No newline at end of file +package com.fr.design.module; + +import com.fr.chart.base.ChartInternationalNameContentBean; +import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.chart.charttypes.ChartTypeManager; +import com.fr.design.ChartTypeInterfaceManager; +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.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.map.server.ChartMapEditorAction; +import com.fr.stable.ArrayUtils; +import com.fr.stable.bridge.StableFactory; +import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; + +import javax.swing.*; + +/** + * Created by IntelliJ IDEA. + * Author : Richer + * Version: 7.0.3 + * Date: 13-7-8 + * Time: 上午9:13 + */ +public class ChartDesignerModule extends DesignModule { + public void start() { + super.start(); + dealBeforeRegister(); + register(); + registerFloatEditor(); + } + + protected void dealBeforeRegister(){ + 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); + DesignModuleFactory.registerChartComponentClass(ChartComponent.class); + + DesignModuleFactory.registerChartDialogClass(ChartDialog.class); + + DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); + + ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); + ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction()); + } + + protected void registerFloatEditor() { + ActionFactory.registerChartCollection(ChartCollection.class); + } + + /** + * 返回设计器能打开的模板类型的一个数组列表 + * + * @return 可以打开的模板类型的数组 + */ + public App[] apps4TemplateOpener() { + return new App[0]; + } + protected WidgetOption[] options4Show() { + ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); + ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; + for (int i = 0; i < typeName.length; i++) { + String plotID = typeName[i].getPlotID(); + Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); + if (ArrayUtils.isEmpty(rowChart)) { + continue; + } + String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); + Icon icon = IOUtils.readIcon(iconPath); + child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); + } + return child; + } + + public String getInterNationalName() { + return Inter.getLocText("FR-Chart-Design_ChartModule"); + } + + +}