From 796e7be795ed89911b00ef8fe3a9afaaa90202b8 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Thu, 14 Nov 2019 10:21:42 +0800 Subject: [PATCH] =?UTF-8?q?CHART-11093=20=E4=B8=8D=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E7=B1=BB=E5=9E=8B=E4=B8=8D=E5=90=8C=E5=B0=B1?= =?UTF-8?q?=E4=B8=8Dpopulate=20=E9=AA=8C=E8=AF=81=E4=BA=86=E6=B2=A1?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/chartx/single/CellDataPane.java | 13 +++---------- .../com/fr/design/chartx/single/DataSetPane.java | 14 +++----------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/CellDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/CellDataPane.java index 075bb54bf7..9f0ac9e80d 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/CellDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/CellDataPane.java @@ -1,11 +1,9 @@ package com.fr.design.chartx.single; import com.fr.chartx.data.CellDataDefinition; -import com.fr.chartx.data.field.AbstractColumnFieldCollection; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chartx.fields.AbstractCellDataFieldsPane; import com.fr.design.i18n.Toolkit; -import com.fr.log.FineLoggerFactory; import com.fr.stable.AssistUtils; import java.awt.BorderLayout; @@ -48,15 +46,10 @@ public class CellDataPane extends FurtherBasicBeanPane { @Override public void populateBean(CellDataDefinition ob) { - try { - Type dataType = ((ParameterizedType) cellDataFieldsPane.getClass().getGenericSuperclass()).getActualTypeArguments()[0]; - if (ob.getColumnFieldCollection() != null && !AssistUtils.equals(ob.getColumnFieldCollection().getClass(), dataType)) { - Object fieldCollection = Class.forName(((Class) dataType).getName()).newInstance(); - ob.setColumnFieldCollection((AbstractColumnFieldCollection) fieldCollection); - } + + Type dataType = ((ParameterizedType) cellDataFieldsPane.getClass().getGenericSuperclass()).getActualTypeArguments()[0]; + if (AssistUtils.equals(ob.getColumnFieldCollection().getClass(), dataType)) { cellDataFieldsPane.populateBean(ob.getColumnFieldCollection()); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java index ceae5302ad..91d1a06881 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java @@ -1,7 +1,6 @@ package com.fr.design.chartx.single; import com.fr.chartx.data.DataSetDefinition; -import com.fr.chartx.data.field.AbstractColumnFieldCollection; import com.fr.data.impl.NameTableData; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; @@ -12,7 +11,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane; import com.fr.design.utils.gui.UIComponentUtils; -import com.fr.log.FineLoggerFactory; import com.fr.stable.AssistUtils; import java.awt.BorderLayout; @@ -105,16 +103,10 @@ public class DataSetPane extends FurtherBasicBeanPane { refreshBoxList(); checkBoxUse(); - try { - Type dataType = ((ParameterizedType) dataSetFieldsPane.getClass().getGenericSuperclass()).getActualTypeArguments()[0]; - if (ob.getColumnFieldCollection() != null && !AssistUtils.equals(ob.getColumnFieldCollection().getClass(), dataType)) { - Object fieldCollection = Class.forName(((Class) dataType).getName()).newInstance(); - ob.setColumnFieldCollection((AbstractColumnFieldCollection) fieldCollection); - } - tableDataPane.populateBean(ob.getNameTableData()); + tableDataPane.populateBean(ob.getNameTableData()); + Type dataType = ((ParameterizedType) dataSetFieldsPane.getClass().getGenericSuperclass()).getActualTypeArguments()[0]; + if (AssistUtils.equals(ob.getColumnFieldCollection().getClass(), dataType)) { dataSetFieldsPane.populateBean(ob.getColumnFieldCollection()); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); } }