/**
* Opens a file chooser and gives the user an opportunity to save the chart
* in PNG format.
*
* @throws IOException if there is an I/O error.
*/
public void doSaveAs() throws IOException {
FileDialog fileDialog = new FileDialog(this.canvas.getShell(),
SWT.SAVE);
String[] extensions = {"*.png"};
fileDialog.setFilterExtensions(extensions);
String filename = fileDialog.open();
if (filename != null) {
if (isEnforceFileExtensions()) {
if (!filename.endsWith(".png")) {
filename = filename + ".png";
}
}
//TODO replace getSize by getBounds ?
ChartUtilities.saveChartAsPNG(new File(filename), this.chart,
this.canvas.getSize().x, this.canvas.getSize().y);
}
}
ChartComposite.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:ccu-historian
作者:
评论列表
文章目录