*
* @throws IOException if there is an I/O error.
*/
public void doSaveAs() throws IOException {
SaveImageDialog dialog = new SaveImageDialog(EncogWorkBench.getInstance().getMainWindow());
dialog.getImageWidth().setValue(640);
dialog.getImageHeight().setValue(480);
if( dialog.process() ) {
File filename = new File(dialog.getTargetFile().getValue());
int width = dialog.getImageWidth().getValue();
int height = dialog.getImageHeight().getValue();
switch( dialog.getFileType().getSelectedIndex()) {
case 0:
filename = new File(FileUtil.forceExtension(filename.toString(), "png"));
ChartUtilities.saveChartAsPNG(filename, this.getChart(),
width,height);
break;