loadParameters.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
FileChooser fc = new FileChooser();
fc.setTitle("Open .par file...");
fc.getExtensionFilters().add(new ExtensionFilter("CGP parameter files", "*.par"));
fc.getExtensionFilters().add(new ExtensionFilter("All files", "*.*"));
File parFile = fc.showOpenDialog(gui.getStage());
if (parFile != null) {
gui.getExperiment().loadParameters(parFile);
gui.reDraw();
refreshFunctions();
}
gui.flushConsole();
}
});
loadChromosome.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
FileChooser fc = new FileChooser();
fc.setTitle("Load .chr file...");
fc.getExtensionFilters().add(new ExtensionFilter("CGP chromosome files", "*.chr"));
fc.getExtensionFilters().add(new ExtensionFilter("All files", "*.*"));
File chrFile = fc.showOpenDialog(gui.getStage());
if (chrFile != null) {
gui.getExperiment().loadChromosome(chrFile, gui.getChromosomeIndex());
gui.reDraw();
}
gui.flushConsole();
}
});
saveChromosome.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
FileChooser fc = new FileChooser();
fc.setTitle("Save .chr file...");
fc.getExtensionFilters().add(new ExtensionFilter("CGP chromosome files", "*.chr"));
fc.getExtensionFilters().add(new ExtensionFilter("All files", "*.*"));
File chrFile = fc.showSaveDialog(gui.getStage());
if (chrFile != null) {
gui.getExperiment().saveChromosome(chrFile, gui.getChromosomeIndex());
}
gui.flushConsole();