From d64b28795db65468421bd90c6207b1856a68d507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 30 Jun 2020 16:20:27 +0800 Subject: [PATCH] =?UTF-8?q?CHART-14449=20=E5=88=87=E6=8D=A2=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=9C=80=E8=A6=81=E9=87=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/ChartTypePane.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) 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 b363dc5f6..1fa61298a 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 @@ -111,12 +111,15 @@ public class ChartTypePane extends AbstractChartAttrPane { autoButtonListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { + final String lastId = editingCollection.getSelectedChartProvider(ChartProvider.class).getID(); final MiddleChartDialog autoChartDialog = DesignModuleFactory.getAutoChartDialog(DesignerContext.getDesignerFrame()); autoChartDialog.populate(editingCollection); autoChartDialog.addDialogActionListener(new DialogActionAdapter() { @Override public void doOk() { populate(editingCollection); + ChartProvider chart = editingCollection.getSelectedChartProvider(ChartProvider.class); + reLayoutEditPane(chart, lastId); } }); autoChartDialog.setVisible(true); @@ -124,6 +127,17 @@ public class ChartTypePane extends AbstractChartAttrPane { }; } + private void reLayoutEditPane(ChartProvider chart, String lastChartId) { + String chartId = chart.getID(); + //chartID改变的话图表类型就算改变了 + if (StringUtils.isNotEmpty(chartId)) { + boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartId); + if (editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastChartId, chartId))) { + editPane.reLayout(chart); + } + } + } + class ComboBoxPane extends UIComboBoxPane { private Map>> allChartTypePane; @@ -167,17 +181,7 @@ public class ChartTypePane extends AbstractChartAttrPane { //这一步会替换plot ((AbstractChartTypePane) getSelectedPane()).updateBean(chart); - String chartID = chart.getID(); - - //chartID改变的话图表类型就算改变了 - if (StringUtils.isNotEmpty(chartID)) { - - boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartID); - - if (editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, chartID))) { - editPane.reLayout(chart); - } - } + reLayoutEditPane(chart,lastPlotID); } protected UIComboBox createComboBox() {