You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.4 KiB

2 years ago
package com.fr.plugin.pielinecomb.data;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane;
import com.fr.plugin.pielinecomb.PieLineCombChart;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
public class CombDataPane extends ChartDataPane {
private PieLineCombChart chart;
public CombDataPane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected JPanel createContentPane() {
String dataType = "";
if (null != chart) {
dataType = chart.getDataType();
}
this.contentsPane = new AbstractMultiDataContentsPane(dataType) {
@Override
protected List<NormalChartDataPane> createPaneList() {
ArrayList localArrayList = new ArrayList();
if (null != chart && chart.getChartType() == 0) {
localArrayList.add(new PieDataPane(CombDataPane.this.listener, CombDataPane.this));
} else if (null != chart && chart.getChartType() == 1) {
localArrayList.add(new LineDataPane(CombDataPane.this.listener, CombDataPane.this));
} else {
localArrayList.add(new PieDataPane(CombDataPane.this.listener, CombDataPane.this));
localArrayList.add(new LineDataPane(CombDataPane.this.listener, CombDataPane.this));
}
return localArrayList;
}
@Override
public void dataPaneTabChange(String dataType) {
CombDataPane.this.chart.setDataType(dataType);
}
};
return this.contentsPane;
}
protected JPanel createContentPane(ChartCollection paramChartCollection) {
chart = paramChartCollection.getSelectedChart(PieLineCombChart.class);
return createContentPane();
}
@Override
protected void repeatLayout(ChartCollection chartCollection) {
if (this.contentsPane != null) {
remove(this.contentsPane);
}
setLayout(new BorderLayout(0, 0));
createContentPane(chartCollection);
if (this.contentsPane != null) {
this.contentsPane.setSupportCellData(isSupportCellData());
}
}
}