|
|
@ -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 |
|
|
|
@Override |
|
|
|
protected List<ChartImagePane> initDemoList() { |
|
|
|
public Plot getSelectedClonedPlot() { |
|
|
|
List <ChartImagePane> demoList = new ArrayList<ChartImagePane>(); |
|
|
|
EChartsPiePlot newPlot = null; |
|
|
|
String[] iconPaths = getTypeIconPath(); |
|
|
|
Chart[] pieChart = EChartsPie.charts; |
|
|
|
ChartImagePane pane = new ChartImagePane(iconPaths[0], "Regular"); |
|
|
|
for(int i = 0, len = pieChart.length; i < len; i++){ |
|
|
|
pane.isPressing = true; |
|
|
|
if(typeDemo.get(i).isPressing){ |
|
|
|
demoList.add(pane); |
|
|
|
newPlot = (EChartsPiePlot)pieChart[i].getPlot(); |
|
|
|
demoList.add(new ChartImagePane(iconPaths[1], "Circle")); |
|
|
|
} |
|
|
|
return demoList; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Plot cloned = null; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
cloned = (Plot)newPlot.clone(); |
|
|
|
|
|
|
|
} catch (CloneNotSupportedException e) { |
|
|
|
|
|
|
|
FRLogger.getLogger().error("Error In ColumnChart"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return cloned; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
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 |
|
|
|
@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" |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |