|
|
|
@ -1,8 +1,11 @@
|
|
|
|
|
package com.fr.solution.plugin.chart.echarts.pie.ui; |
|
|
|
|
|
|
|
|
|
import com.fr.chart.chartattr.Chart; |
|
|
|
|
import com.fr.chart.chartattr.Plot; |
|
|
|
|
import com.fr.design.mainframe.chart.gui.type.ChartImagePane; |
|
|
|
|
import com.fr.general.FRLogger; |
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
import com.fr.solution.plugin.chart.echarts.common.base.ECharts; |
|
|
|
|
import com.fr.solution.plugin.chart.echarts.pie.EChartsPie; |
|
|
|
|
import com.fr.solution.plugin.chart.echarts.pie.plot.EChartsPiePlot; |
|
|
|
|
import com.fr.solution.plugin.chart.echarts.common.ui.AbstractEChartsTypePane; |
|
|
|
@ -23,12 +26,6 @@ public class EChartsPieChartTypePane extends AbstractEChartsTypePane {
|
|
|
|
|
return Inter.getLocText("Plugin-ECharts_Pie"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void updateBean(Chart chart) { |
|
|
|
|
if (chart != null) { |
|
|
|
|
chart.setPlot(new EChartsPiePlot()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 界面是否接受 |
|
|
|
|
* |
|
|
|
@ -44,23 +41,53 @@ public class EChartsPieChartTypePane extends AbstractEChartsTypePane {
|
|
|
|
|
return EChartsPie.charts[0]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void populateBean(Chart chart) { |
|
|
|
|
for(ChartImagePane imagePane : typeDemo) { |
|
|
|
|
imagePane.isPressing = false; |
|
|
|
|
} |
|
|
|
|
Plot plot = chart.getPlot(); |
|
|
|
|
if(plot instanceof EChartsPiePlot) { |
|
|
|
|
lastTypeIndex = ((EChartsPiePlot)plot).getPieType().ordinal(); |
|
|
|
|
typeDemo.get(lastTypeIndex).isPressing = true; |
|
|
|
|
} |
|
|
|
|
checkDemosBackground(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Plot getSelectedClonedPlot() { |
|
|
|
|
EChartsPiePlot newPlot = null; |
|
|
|
|
Chart[] pieChart = EChartsPie.charts; |
|
|
|
|
for(int i = 0, len = pieChart.length; i < len; i++){ |
|
|
|
|
if(typeDemo.get(i).isPressing){ |
|
|
|
|
newPlot = (EChartsPiePlot)pieChart[i].getPlot(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Plot cloned = null; |
|
|
|
|
try { |
|
|
|
|
cloned = (Plot)newPlot.clone(); |
|
|
|
|
} catch (CloneNotSupportedException e) { |
|
|
|
|
FRLogger.getLogger().error("Error In ColumnChart"); |
|
|
|
|
} |
|
|
|
|
return cloned; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected List<ChartImagePane> initDemoList() { |
|
|
|
|
List <ChartImagePane> demoList = new ArrayList<ChartImagePane>(); |
|
|
|
|
String[] iconPaths = getTypeIconPath(); |
|
|
|
|
ChartImagePane pane = new ChartImagePane(iconPaths[0], "Regular"); |
|
|
|
|
pane.isPressing = true; |
|
|
|
|
demoList.add(pane); |
|
|
|
|
demoList.add(new ChartImagePane(iconPaths[1], "Circle")); |
|
|
|
|
return demoList; |
|
|
|
|
public String[] getIconsOfTypes() { |
|
|
|
|
return new String[]{ |
|
|
|
|
"/com/fr/solution/plugin/chart/echarts/pie/images/pie_type_none.png", |
|
|
|
|
"/com/fr/solution/plugin/chart/echarts/pie/images/pie_type_area.png", |
|
|
|
|
"/com/fr/solution/plugin/chart/echarts/pie/images/pie_type_radius.png", |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected String[] getTypeIconPath() { |
|
|
|
|
public String[] getNamesOfTypes() { |
|
|
|
|
return new String[]{ |
|
|
|
|
"/com/fr/solution/plugin/chart/echarts/pie/images/pie_type1.png", |
|
|
|
|
"/com/fr/solution/plugin/chart/echarts/pie/images/pie_type2.png" |
|
|
|
|
"Normal", |
|
|
|
|
"Area", |
|
|
|
|
"Redius" |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |