From 031b17b3dbbcdef6e8ae926f88587b71df2f5135 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 May 2020 15:53:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E4=BB=A3=E7=A0=81=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/FormCreatorDropTarget.java | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index 06cb19d0ae..0a6e692f49 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; -import com.fr.base.chart.BaseChartCollection; import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.attr.ChartProvider; import com.fr.design.DesignModelAdapter; @@ -28,12 +27,9 @@ import com.fr.form.share.ShareLoader; import com.fr.form.ui.ChartEditor; import com.fr.form.ui.Widget; import com.fr.stable.Constants; -import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JWindow; -import java.util.List; -import java.util.Map; import java.awt.Color; import java.awt.Component; import java.awt.Point; @@ -97,7 +93,7 @@ public class FormCreatorDropTarget extends DropTarget { //SetSelection时要确保选中的是最顶层的布局 //tab布局添加的时候是初始化了XWCardLayout,实际上最顶层的布局是XWCardMainBorderLayout XCreator addingXCreator = addingModel.getXCreator(); - Widget widget = (addingXCreator.getBackupParent() != null && addingXCreator.getTopLayout() != null) ? (addingXCreator.getTopLayout().toData()) : addingXCreator.toData(); + Widget widget = (addingXCreator.getTopLayout() != null) ? (addingXCreator.getTopLayout().toData()) : addingXCreator.toData(); //图表埋点 dealChartBuryingPoint(widget); if (addingXCreator.isShared()) { @@ -288,16 +284,9 @@ public class FormCreatorDropTarget extends DropTarget { } private void dealChartBuryingPoint(Widget widget) { - List chartCollections = widget.getChartCollections(); - for (BaseChartCollection baseChartCollection : chartCollections) { - ChartCollection chartCollection = (ChartCollection) baseChartCollection; - for (int i = 0, size = chartCollection.getChartCount(); i < size; i++) { - ChartProvider chart = chartCollection.getChart(i, ChartProvider.class); - //是否是共享的复用组件 - boolean isReuse = StringUtils.isNotEmpty(this.addingModel.getXCreator().getShareId()); - ChartInfoCollector.getInstance().collection(chart, null, isReuse); - ChartInfoCollector.getInstance().checkTestChart(chart); - } + if (widget instanceof ChartEditor) { + ChartCollection chartCollection = (ChartCollection)((ChartEditor) widget).getChartCollection(); + ChartInfoCollector.getInstance().collection(chartCollection.getSelectedChartProvider(ChartProvider.class), null); } } }