From 6769419bea279935c4a3a84616d45ee7d4a6345c Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Tue, 22 Apr 2014 08:48:11 +0100 Subject: Chromosome parser is buggy, need to fix that. --- src/jcgp/gui/settings/SettingsPane.java | 13 ++++++++++--- src/jcgp/gui/settings/parameters/GUIDoubleParameter.java | 1 - src/jcgp/gui/settings/parameters/GUIParameter.java | 1 - 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/jcgp/gui') diff --git a/src/jcgp/gui/settings/SettingsPane.java b/src/jcgp/gui/settings/SettingsPane.java index 4050a89..302e96d 100644 --- a/src/jcgp/gui/settings/SettingsPane.java +++ b/src/jcgp/gui/settings/SettingsPane.java @@ -326,12 +326,12 @@ public class SettingsPane extends AnchorPane { @Override public void handle(ActionEvent event) { FileChooser fc = new FileChooser(); - fc.setTitle("Open .chr file..."); + 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.getExperiment().loadChromosome(chrFile, 0); gui.reDraw(); } } @@ -339,7 +339,14 @@ public class SettingsPane extends AnchorPane { saveChromosome.setOnAction(new EventHandler() { @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, 0); + } } }); diff --git a/src/jcgp/gui/settings/parameters/GUIDoubleParameter.java b/src/jcgp/gui/settings/parameters/GUIDoubleParameter.java index 9a6ec4a..5331364 100644 --- a/src/jcgp/gui/settings/parameters/GUIDoubleParameter.java +++ b/src/jcgp/gui/settings/parameters/GUIDoubleParameter.java @@ -100,7 +100,6 @@ public class GUIDoubleParameter extends GUIParameter { @Override public void refreshValue() { - System.out.println("setting text to: " + parameter.get().doubleValue()); textField.setText(decimalFormat.format(parameter.get().doubleValue())); } } diff --git a/src/jcgp/gui/settings/parameters/GUIParameter.java b/src/jcgp/gui/settings/parameters/GUIParameter.java index 7dd7231..c6ac2e6 100644 --- a/src/jcgp/gui/settings/parameters/GUIParameter.java +++ b/src/jcgp/gui/settings/parameters/GUIParameter.java @@ -85,7 +85,6 @@ public abstract class GUIParameter extends HBox { // the tooltip is the hover-over label containing status information, when appropriate tooltip = new Tooltip(); - tooltip.setStyle("-fx-background-color: white; -fx-border-color: black;"); tooltip.setSkin(null); valueControl = makeControl(); -- cgit v1.2.3