Browse Source

CHART-14449 切换类型需要重置面板

feature/big-screen
白岳 4 years ago
parent
commit
d64b28795d
  1. 26
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

26
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() { autoButtonListener = new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
final String lastId = editingCollection.getSelectedChartProvider(ChartProvider.class).getID();
final MiddleChartDialog autoChartDialog = DesignModuleFactory.getAutoChartDialog(DesignerContext.getDesignerFrame()); final MiddleChartDialog autoChartDialog = DesignModuleFactory.getAutoChartDialog(DesignerContext.getDesignerFrame());
autoChartDialog.populate(editingCollection); autoChartDialog.populate(editingCollection);
autoChartDialog.addDialogActionListener(new DialogActionAdapter() { autoChartDialog.addDialogActionListener(new DialogActionAdapter() {
@Override @Override
public void doOk() { public void doOk() {
populate(editingCollection); populate(editingCollection);
ChartProvider chart = editingCollection.getSelectedChartProvider(ChartProvider.class);
reLayoutEditPane(chart, lastId);
} }
}); });
autoChartDialog.setVisible(true); 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<ChartProvider> { class ComboBoxPane extends UIComboBoxPane<ChartProvider> {
private Map<String, Map<String, FurtherBasicBeanPane<? extends ChartProvider>>> allChartTypePane; private Map<String, Map<String, FurtherBasicBeanPane<? extends ChartProvider>>> allChartTypePane;
@ -167,17 +181,7 @@ public class ChartTypePane extends AbstractChartAttrPane {
//这一步会替换plot //这一步会替换plot
((AbstractChartTypePane) getSelectedPane()).updateBean(chart); ((AbstractChartTypePane) getSelectedPane()).updateBean(chart);
String chartID = chart.getID(); reLayoutEditPane(chart,lastPlotID);
//chartID改变的话图表类型就算改变了
if (StringUtils.isNotEmpty(chartID)) {
boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(chartID);
if (editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, chartID))) {
editPane.reLayout(chart);
}
}
} }
protected UIComboBox createComboBox() { protected UIComboBox createComboBox() {

Loading…
Cancel
Save