|
|
|
@ -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<ChartProvider> { |
|
|
|
|
private Map<String, Map<String, FurtherBasicBeanPane<? extends ChartProvider>>> 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() { |
|
|
|
|