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 b363dc5f6b..1fa61298a5 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() {