From 2b571f08d091dc062cedbb9816c29dcf0cbd4f12 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Thu, 22 May 2014 07:44:52 +0100 Subject: Final commit, will release later today. --- src/jcgp/gui/console/ConsolePane.java | 1 - src/jcgp/gui/population/ChromosomePane.java | 11 ++++++++++- src/jcgp/gui/population/FunctionSelector.java | 8 ++++++++ src/jcgp/gui/settings/SettingsPane.java | 16 ++++++++-------- 4 files changed, 26 insertions(+), 10 deletions(-) (limited to 'src/jcgp/gui') diff --git a/src/jcgp/gui/console/ConsolePane.java b/src/jcgp/gui/console/ConsolePane.java index c4cfc21..1e07b7d 100644 --- a/src/jcgp/gui/console/ConsolePane.java +++ b/src/jcgp/gui/console/ConsolePane.java @@ -37,7 +37,6 @@ public class ConsolePane extends AnchorPane implements Console { public ConsolePane() { super(); textArea.setEditable(false); - /* * This nasty hack is needed because the default TextArea ContextMenu is not * in the public API, making it impossible to override it with a custom one. diff --git a/src/jcgp/gui/population/ChromosomePane.java b/src/jcgp/gui/population/ChromosomePane.java index d9154fc..1e04c37 100644 --- a/src/jcgp/gui/population/ChromosomePane.java +++ b/src/jcgp/gui/population/ChromosomePane.java @@ -12,6 +12,15 @@ import jcgp.backend.population.Node; import jcgp.backend.resources.Resources; import jcgp.gui.GUI; +/** + * This extension of {@code ScrollPane} contains a series of + * nodes, inputs and outputs spread across a grid. It also contains + * all of the connection lines overlaid over the nodes, inputs and outputs. + * + * + * @author Eduardo Pedroni + * + */ public class ChromosomePane extends ScrollPane { private GUINode[][] guiNodes; @@ -169,7 +178,7 @@ public class ChromosomePane extends ScrollPane { } /** - * @return the evaluating + * @return the evaluating attribute. */ public boolean isEvaluating() { return parent.isEvaluating(); diff --git a/src/jcgp/gui/population/FunctionSelector.java b/src/jcgp/gui/population/FunctionSelector.java index 69d0d31..0e6c6bb 100644 --- a/src/jcgp/gui/population/FunctionSelector.java +++ b/src/jcgp/gui/population/FunctionSelector.java @@ -7,6 +7,14 @@ import javafx.scene.layout.VBox; import jcgp.backend.function.FunctionSet; import jcgp.gui.GUI; +/** + * A menu class, exposes all of the allowed functions + * when called by a node, so that the node function can be changed. + * + * + * @author Eduardo Pedroni + * + */ public class FunctionSelector extends VBox { private GUINode target; diff --git a/src/jcgp/gui/settings/SettingsPane.java b/src/jcgp/gui/settings/SettingsPane.java index c0939e9..c59244b 100644 --- a/src/jcgp/gui/settings/SettingsPane.java +++ b/src/jcgp/gui/settings/SettingsPane.java @@ -157,25 +157,25 @@ public class SettingsPane extends AnchorPane { header.setFont(Font.font("Arial", 14)); header.setUnderline(true); - final ComboBox eaCBox = new ComboBox(); - eaCBox.getItems().addAll(jcgp.getEvolutionaryStrategies()); - eaCBox.getSelectionModel().select(jcgp.getEvolutionaryStrategy()); - eaCBox.prefWidthProperty().bind(mainContainer.widthProperty()); + final ComboBox esCBox = new ComboBox(); + esCBox.getItems().addAll(jcgp.getEvolutionaryStrategies()); + esCBox.getSelectionModel().select(jcgp.getEvolutionaryStrategy()); + esCBox.prefWidthProperty().bind(mainContainer.widthProperty()); final VBox eaParameters = new VBox(2); refreshParameters(jcgp.getEvolutionaryStrategy().getLocalParameters(), eaParameters); - eaCBox.setOnAction(new EventHandler() { + esCBox.setOnAction(new EventHandler() { @Override public void handle(ActionEvent event) { - jcgp.setEvolutionaryStrategy(eaCBox.getSelectionModel().getSelectedIndex()); - refreshParameters(eaCBox.getSelectionModel().getSelectedItem().getLocalParameters(), eaParameters); + jcgp.setEvolutionaryStrategy(esCBox.getSelectionModel().getSelectedIndex()); + refreshParameters(esCBox.getSelectionModel().getSelectedItem().getLocalParameters(), eaParameters); gui.flushConsole(); } }); - eaPane.getChildren().addAll(header, eaCBox, eaParameters); + eaPane.getChildren().addAll(header, esCBox, eaParameters); mainContainer.getChildren().add(eaPane); } -- cgit v1.2.3