return copy;
}
//ask user where to save the data
File askForFile() {
AFileChooser fileChooser;//a custom JFileChooser which remembers last location
fileChooser = new AFileChooser((java.awt.Frame) null, true, LAST_DATA_FILE_PATH_KEY);
fileChooser.setDialogTitle("Select a file to save random data");
FileNameExtensionFilter filter = new FileNameExtensionFilter("raw data file", "dat");
fileChooser.addChoosableFileFilter(filter);
fileChooser.setAcceptAllFileFilterUsed(true);
long start = System.nanoTime();
int option = fileChooser.showOpenDialog(null);
deadTime += System.nanoTime() - start;
fileChooser.dispose();
if (option != JFileChooser.APPROVE_OPTION) {
throw new StopRequestFromUserException();//if user give up, we give up too...
}
fileChooser.saveCurrentPath();//tell the file chooser to remember this location
outputFile = fileChooser.getSelectedFile();
outputFileClonned = false;
return outputFile;
}