From b02b72de9bf4a3e1e70b50b06825069e137469bd Mon Sep 17 00:00:00 2001 From: Lanlan Date: Thu, 14 Jan 2021 09:36:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-46953=20GeneralXMLTools=20=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/module/DesignerActivator.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 495252e38f..3f1aa26636 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 @@ -99,7 +99,6 @@ import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.painter.BiasTextPainter; import com.fr.report.cell.painter.CellImagePainter; import com.fr.stable.ArrayUtils; -import com.fr.stable.EssentialUtils; import com.fr.stable.ParameterProvider; import com.fr.stable.bridge.StableFactory; import com.fr.stable.os.support.OSBasedAction; @@ -192,8 +191,8 @@ public class DesignerActivator extends Activator { justStartModules4Designer(); CalculatorProviderContext.setValueConverter(valueConverter()); - EssentialUtils.Object_Tokenizer = startXMLReadObjectTokenizer(); - EssentialUtils.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); + GeneralXMLTools.Object_Tokenizer = startXMLReadObjectTokenizer(); + GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); addAdapterForPlate(); designerRegister(); From 6a3c3604cac33c8d128e8b2a66535191e6e7fc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 15 Jan 2021 13:36:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?CHART-15837=20feature=E2=86=92release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractCustomFieldComboBoxPane.java | 6 +- .../chart/gui/data/CalculateComboBox.java | 102 +++++++++--------- .../table/SeriesNameUseFieldNamePane.java | 2 +- 3 files changed, 57 insertions(+), 53 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java index 16f983c758..562393699d 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java @@ -23,13 +23,13 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import java.util.ArrayList; +import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.util.ArrayList; -import java.util.List; /** * Created by shine on 2018/9/12. @@ -253,7 +253,7 @@ public abstract class AbstractCustomFieldComboBoxPane extends BasicBeanPane= 0 && selectIndex < CLASS_ARRAY.length) { - return (AbstractDataFunction)CLASS_ARRAY[selectIndex].newInstance(); - } - } catch (InstantiationException e) { - FineLoggerFactory.getLogger().error("Function Error"); - return null; - } catch (IllegalAccessException e) { - FineLoggerFactory.getLogger().error("Function Error"); - return null; - } - - return null; - } + public static final String[] CALCULATE_ARRAY = {Toolkit.i18nText("Fine-Design_Chart_Data_Function_First"), Toolkit.i18nText("Fine-Design_Chart_Data_Function_Last"), + Toolkit.i18nText("Fine-Design_Chart_Data_Function_Sum"), Toolkit.i18nText("Fine-Design_Chart_Data_Function_Average"), + Toolkit.i18nText("Fine-Design_Chart_Data_Function_Max"), Toolkit.i18nText("Fine-Design_Chart_Data_Function_Min"), + Toolkit.i18nText("Fine-Design_Chart_Data_Function_Count")}; + public static final Class[] CLASS_ARRAY = {FirstFunction.class, NoneFunction.class, SumFunction.class, AverageFunction.class, + MaxFunction.class, MinFunction.class, CountFunction.class}; + + public CalculateComboBox() { + super(CALCULATE_ARRAY); + setSelectedIndex(2); + } + + public void reset() { + this.setSelectedItem(Toolkit.i18nText("Fine-Design_Chart_Data_Function_Sum")); + } + + /** + * 更新公式选择. + */ + public void populateBean(AbstractDataFunction function) { + for (int i = 0; i < CLASS_ARRAY.length; i++) { + if (function != null && ComparatorUtils.equals(function.getClass(), CLASS_ARRAY[i])) { + setSelectedIndex(i); + break; + } + } + } + + /** + * 返回当前选择的公式 + */ + public AbstractDataFunction updateBean() { + try { + int selectIndex = getSelectedIndex(); + if (selectIndex >= 0 && selectIndex < CLASS_ARRAY.length) { + return (AbstractDataFunction) CLASS_ARRAY[selectIndex].newInstance(); + } + } catch (InstantiationException e) { + FineLoggerFactory.getLogger().error("Function Error"); + return null; + } catch (IllegalAccessException e) { + FineLoggerFactory.getLogger().error("Function Error"); + return null; + } + + return null; + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java index 3f5f70aae3..9783c0577a 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java @@ -70,7 +70,7 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane