From f0988f7d6cb1dabfed3d13ac412b2822fce66b39 Mon Sep 17 00:00:00 2001 From: "stephan.pirnbaum" Date: Fri, 26 Jul 2019 17:44:38 +0200 Subject: [PATCH] #27 added field to choose architecture model --- .../app/ui/ConfigurationDialogController.java | 21 ++++++++++++++++++- .../resources/views/configuration_dialog.fxml | 14 ++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/sar-framework-app/src/main/java/com/buschmais/sarf/app/ui/ConfigurationDialogController.java b/sar-framework-app/src/main/java/com/buschmais/sarf/app/ui/ConfigurationDialogController.java index 6fe1551..11b5067 100644 --- a/sar-framework-app/src/main/java/com/buschmais/sarf/app/ui/ConfigurationDialogController.java +++ b/sar-framework-app/src/main/java/com/buschmais/sarf/app/ui/ConfigurationDialogController.java @@ -9,10 +9,13 @@ import javafx.scene.control.CheckBox; import javafx.scene.control.ProgressBar; import javafx.scene.control.TextField; +import javafx.stage.FileChooser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Controller; +import java.io.File; + /** * @author Stephan Pirnbaum */ @@ -49,6 +52,12 @@ public class ConfigurationDialogController extends AbstractController { @FXML private TextField populationSize; + @FXML + private TextField architecturePath; + + @FXML + private Button chooseArchitecture; + @Autowired @Lazy ClassificationRunner classificationRunner; @@ -69,9 +78,9 @@ public void initialize() { generations.setText(newValue.replaceAll("[^\\d]", "")); } })); + this.chooseArchitecture.setOnAction(e -> this.selectArchitecture()); } - private void execute() { this.execute.setDisable(true); try { @@ -94,4 +103,14 @@ private void execute() { this.execute.setDisable(false); } + private void selectArchitecture() { + FileChooser chooser = new FileChooser(); + chooser.setTitle("Select Architecture Model"); + File f; + chooser.setSelectedExtensionFilter(new FileChooser.ExtensionFilter("xml", "xml")); + if ((f = chooser.showOpenDialog(this.chooseArchitecture.getScene().getWindow())) != null) { + this.architecturePath.setText(f.toURI().toString()); + } + } + } diff --git a/sar-framework-app/src/main/resources/views/configuration_dialog.fxml b/sar-framework-app/src/main/resources/views/configuration_dialog.fxml index d9e1937..4ddc515 100644 --- a/sar-framework-app/src/main/resources/views/configuration_dialog.fxml +++ b/sar-framework-app/src/main/resources/views/configuration_dialog.fxml @@ -1,6 +1,6 @@ - + @@ -19,6 +19,7 @@ + @@ -40,12 +41,19 @@ - -