diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index e37409075..014778cac 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -12,10 +12,8 @@ import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chart.fun.ChartTypeUIProvider; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.condition.ConditionAttributesPane; -import com.fr.design.gui.core.CustomWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.design.mainframe.chart.ChartsConfigPane; @@ -43,7 +41,6 @@ import com.fr.design.type.ui.RangeChartTypeUI; import com.fr.design.type.ui.StockChartTypeUI; import com.fr.design.type.ui.XYScatterChartTypeUI; import com.fr.extended.chart.AbstractChart; -import com.fr.form.ui.ChartAutoEditor; import com.fr.form.ui.ChartEditor; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; @@ -165,12 +162,8 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr public static WidgetOption[] initWidgetOption() { String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDs(); - List child = new ArrayList<>(); - if (ChartTypeManager.AUTO_CHART) { - //TODO @Bjorn 视觉样式优化icon - child.add(new CustomWidgetOption(Toolkit.i18nText("Fine-Design_Chart_M_Popup_Auto_Chart_Type"), - IOUtils.readIcon("com/fr/design/images/form/toolbar/auto_chart.png"), ChartAutoEditor.class)); - } + ChartWidgetOption[] child = new ChartWidgetOption[chartIDs.length]; + int index = 0; for (String chartID : chartIDs) { ChartProvider[] rowChart = ChartTypeManager.getInstance().getCharts(chartID); @@ -180,10 +173,11 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr String name = ChartTypeInterfaceManager.getInstance().getName(chartID); String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(chartID); Icon icon = IOUtils.readIcon(iconPath); - child.add(new ChartWidgetOption(name, icon, ChartEditor.class, chartID)); + child[index] = new ChartWidgetOption(name, icon, ChartEditor.class, chartID); + index++; } - return child.toArray(new WidgetOption[child.size()]); + return child; } private static void readVanChart() { diff --git a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java index 92e9cca3d..bb0389731 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/insert/flot/AutoChartFloatAction.java @@ -2,6 +2,7 @@ package com.fr.design.actions.insert.flot; import com.fr.base.BaseUtils; import com.fr.design.gui.chart.MiddleChartDialog; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.menu.MenuKeySet; import com.fr.design.module.DesignModuleFactory; @@ -38,7 +39,7 @@ public class AutoChartFloatAction extends ChartFloatAction { @Override public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Auto_Chart"); + return Toolkit.i18nText("Fine-Design_Report_M_Insert_Auto_Chart"); } @Override diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 45d31dcb1..c0a979d6e 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -7,14 +7,12 @@ import com.fr.base.passport.FinePassportListenerAdapter; import com.fr.base.passport.FinePassportManager; import com.fr.base.process.ProcessOperator; import com.fr.chart.chartattr.ChartCollection; -import com.fr.chart.charttypes.ChartTypeManager; import com.fr.config.MarketConfig; import com.fr.decision.update.backup.RecoverManager; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.NewFormAction; import com.fr.design.actions.core.ActionFactory; -import com.fr.design.actions.insert.cell.AutoChartCellAction; import com.fr.design.actions.insert.cell.BiasCellAction; import com.fr.design.actions.insert.cell.ChartCellAction; import com.fr.design.actions.insert.cell.DSColumnCellAction; @@ -23,7 +21,6 @@ import com.fr.design.actions.insert.cell.GeneralCellAction; import com.fr.design.actions.insert.cell.ImageCellAction; import com.fr.design.actions.insert.cell.RichTextCellAction; import com.fr.design.actions.insert.cell.SubReportCellAction; -import com.fr.design.actions.insert.flot.AutoChartFloatAction; import com.fr.design.actions.insert.flot.ChartFloatAction; import com.fr.design.actions.insert.flot.FormulaFloatAction; import com.fr.design.actions.insert.flot.ImageFloatAction; @@ -225,21 +222,16 @@ public class DesignerActivator extends Activator { classes.add(provider.actionForInsertCellElement()); } - List> baseClasses = new ArrayList<>(); - baseClasses.add(DSColumnCellAction.class); - baseClasses.add(GeneralCellAction.class); - baseClasses.add(RichTextCellAction.class); - baseClasses.add(FormulaCellAction.class); - baseClasses.add(ChartCellAction.class); - if(ChartTypeManager.AUTO_CHART) { - baseClasses.add(AutoChartCellAction.class); - } - baseClasses.add(ImageCellAction.class); - baseClasses.add(BiasCellAction.class); - baseClasses.add(SubReportCellAction.class); - - return ArrayUtils.addAll(baseClasses.toArray(new Class[baseClasses.size()]), - classes.toArray(new Class[classes.size()])); + return ArrayUtils.addAll(new Class[]{ + DSColumnCellAction.class, + GeneralCellAction.class, + RichTextCellAction.class, + FormulaCellAction.class, + ChartCellAction.class, + ImageCellAction.class, + BiasCellAction.class, + SubReportCellAction.class + }, classes.toArray(new Class[classes.size()])); } private static Class[] actionsForInsertFloatElement() { @@ -249,16 +241,12 @@ public class DesignerActivator extends Activator { classes.add(provider.actionForInsertFloatElement()); } - List> baseClasses = new ArrayList<>(); - baseClasses.add(TextBoxFloatAction.class); - baseClasses.add(FormulaFloatAction.class); - baseClasses.add(ChartFloatAction.class); - if(ChartTypeManager.AUTO_CHART) { - baseClasses.add(AutoChartFloatAction.class); - } - baseClasses.add(ImageFloatAction.class); - return ArrayUtils.addAll(baseClasses.toArray(new Class[baseClasses.size()]), - classes.toArray(new Class[classes.size()])); + return ArrayUtils.addAll(new Class[]{ + TextBoxFloatAction.class, + FormulaFloatAction.class, + ChartFloatAction.class, + ImageFloatAction.class + }, classes.toArray(new Class[classes.size()])); } private static NameableCreator[] hyperlinkTypes() {