diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index a668fa3b36..985ee28afa 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -221,6 +221,7 @@ public class ChartTypePane extends AbstractChartAttrPane { String lastPlotID = chart.getID(); + boolean chartTypeChange = false; try { AbstractChartTypePane selectedPane = (AbstractChartTypePane) getSelectedPane(); ChartProvider newDefaultChart = (ChartProvider) ChartTypeManager.getInstanceWithCheck().getCharts(selectedPane.getPlotID())[0].clone(); @@ -230,13 +231,16 @@ public class ChartTypePane extends AbstractChartAttrPane { editingCollection.removeNameObject(editingCollection.getSelectedIndex()); editingCollection.addChart(newDefaultChart); chart = newDefaultChart; + chartTypeChange = true; } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } //这一步会替换plot + String id = chart.getID(); ((AbstractChartTypePane) getSelectedPane()).updateBean(chart); - if (inForm) { + chartTypeChange = chartTypeChange || !ComparatorUtils.equals(id, chart.getID()); + if (inForm && chartTypeChange) { chart.resetAttrInForm(); } reLayoutEditPane(chart, lastPlotID); @@ -464,5 +468,6 @@ public class ChartTypePane extends AbstractChartAttrPane { public void registerChartEditPane(ChartEditPane currentEditPane) { this.editPane = currentEditPane; this.inForm = editPane.isInForm(); + buttonPane.refreshChartInForm(inForm); } } \ No newline at end of file