|
|
@ -1,8 +1,11 @@ |
|
|
|
package com.fr.solution.plugin.chart.echarts.pie.ui; |
|
|
|
package com.fr.solution.plugin.chart.echarts.pie.ui; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.chart.chartattr.Chart; |
|
|
|
import com.fr.chart.chartattr.Chart; |
|
|
|
|
|
|
|
import com.fr.chart.chartattr.Plot; |
|
|
|
import com.fr.design.mainframe.chart.gui.type.ChartImagePane; |
|
|
|
import com.fr.design.mainframe.chart.gui.type.ChartImagePane; |
|
|
|
|
|
|
|
import com.fr.general.FRLogger; |
|
|
|
import com.fr.general.Inter; |
|
|
|
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.EChartsPie; |
|
|
|
import com.fr.solution.plugin.chart.echarts.pie.plot.EChartsPiePlot; |
|
|
|
import com.fr.solution.plugin.chart.echarts.pie.plot.EChartsPiePlot; |
|
|
|
import com.fr.solution.plugin.chart.echarts.common.ui.AbstractEChartsTypePane; |
|
|
|
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"); |
|
|
|
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]; |
|
|
|
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 |
|
|
|
@Override |
|
|
|
protected List<ChartImagePane> initDemoList() { |
|
|
|
public String[] getIconsOfTypes() { |
|
|
|
List <ChartImagePane> demoList = new ArrayList<ChartImagePane>(); |
|
|
|
return new String[]{ |
|
|
|
String[] iconPaths = getTypeIconPath(); |
|
|
|
"/com/fr/solution/plugin/chart/echarts/pie/images/pie_type_none.png", |
|
|
|
ChartImagePane pane = new ChartImagePane(iconPaths[0], "Regular"); |
|
|
|
"/com/fr/solution/plugin/chart/echarts/pie/images/pie_type_area.png", |
|
|
|
pane.isPressing = true; |
|
|
|
"/com/fr/solution/plugin/chart/echarts/pie/images/pie_type_radius.png", |
|
|
|
demoList.add(pane); |
|
|
|
}; |
|
|
|
demoList.add(new ChartImagePane(iconPaths[1], "Circle")); |
|
|
|
|
|
|
|
return demoList; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected String[] getTypeIconPath() { |
|
|
|
public String[] getNamesOfTypes() { |
|
|
|
return new String[]{ |
|
|
|
return new String[]{ |
|
|
|
"/com/fr/solution/plugin/chart/echarts/pie/images/pie_type1.png", |
|
|
|
"Normal", |
|
|
|
"/com/fr/solution/plugin/chart/echarts/pie/images/pie_type2.png" |
|
|
|
"Area", |
|
|
|
|
|
|
|
"Redius" |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |