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 @@ - -