|
|
@ -222,6 +222,7 @@ public class ChartTypePane extends AbstractChartAttrPane { |
|
|
|
|
|
|
|
|
|
|
|
String lastPlotID = chart.getID(); |
|
|
|
String lastPlotID = chart.getID(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean chartTypeChange = false; |
|
|
|
try { |
|
|
|
try { |
|
|
|
AbstractChartTypePane selectedPane = (AbstractChartTypePane) getSelectedPane(); |
|
|
|
AbstractChartTypePane selectedPane = (AbstractChartTypePane) getSelectedPane(); |
|
|
|
ChartProvider newDefaultChart = (ChartProvider) ChartTypeManager.getInstanceWithCheck().getCharts(selectedPane.getPlotID())[0].clone(); |
|
|
|
ChartProvider newDefaultChart = (ChartProvider) ChartTypeManager.getInstanceWithCheck().getCharts(selectedPane.getPlotID())[0].clone(); |
|
|
@ -231,13 +232,16 @@ public class ChartTypePane extends AbstractChartAttrPane { |
|
|
|
editingCollection.removeNameObject(editingCollection.getSelectedIndex()); |
|
|
|
editingCollection.removeNameObject(editingCollection.getSelectedIndex()); |
|
|
|
editingCollection.addChart(newDefaultChart); |
|
|
|
editingCollection.addChart(newDefaultChart); |
|
|
|
chart = newDefaultChart; |
|
|
|
chart = newDefaultChart; |
|
|
|
|
|
|
|
chartTypeChange = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (CloneNotSupportedException e) { |
|
|
|
} catch (CloneNotSupportedException e) { |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
} |
|
|
|
} |
|
|
|
//这一步会替换plot
|
|
|
|
//这一步会替换plot
|
|
|
|
|
|
|
|
String id = chart.getID(); |
|
|
|
((AbstractChartTypePane) getSelectedPane()).updateBean(chart); |
|
|
|
((AbstractChartTypePane) getSelectedPane()).updateBean(chart); |
|
|
|
if (inForm) { |
|
|
|
chartTypeChange = chartTypeChange || !ComparatorUtils.equals(id, chart.getID()); |
|
|
|
|
|
|
|
if (inForm && chartTypeChange) { |
|
|
|
chart.resetAttrInForm(); |
|
|
|
chart.resetAttrInForm(); |
|
|
|
} |
|
|
|
} |
|
|
|
reLayoutEditPane(chart, lastPlotID); |
|
|
|
reLayoutEditPane(chart, lastPlotID); |
|
|
@ -465,5 +469,6 @@ public class ChartTypePane extends AbstractChartAttrPane { |
|
|
|
public void registerChartEditPane(ChartEditPane currentEditPane) { |
|
|
|
public void registerChartEditPane(ChartEditPane currentEditPane) { |
|
|
|
this.editPane = currentEditPane; |
|
|
|
this.editPane = currentEditPane; |
|
|
|
this.inForm = editPane.isInForm(); |
|
|
|
this.inForm = editPane.isInForm(); |
|
|
|
|
|
|
|
buttonPane.refreshChartInForm(inForm); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |