Browse Source

异步请求图片

master
Fangjie Hu 8 years ago
parent
commit
f21e01b9a1
  1. 19
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

19
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -87,6 +87,20 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
//异步加载
new Thread(new Runnable() {
@Override
public void run() {
getWidgetOption(typeName, child);
}
}).start();
return child;
}
private static void getWidgetOption(ChartInternationalNameContentBean[] typeName, ChartWidgetOption[] child){
for (int i = 0; i < typeName.length; i++) {
String plotID = typeName[i].getPlotID();
Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID);
@ -94,14 +108,15 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
continue;
}
//初始化图表模型图片
//加载初始化图表模型图片
initChartsDemoImage(rowChart);
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID);
Icon icon = IOUtils.readIcon(iconPath);
child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]);
}
return child;
DesignModuleFactory.registerExtraWidgetOptions(child);
}
private static void initChartsDemoImage(Chart[] rowChart) {

Loading…
Cancel
Save