diff --git a/src/main/java/fr/pasteur/ida/zellige/gui/controller/BatchModeDialog.java b/src/main/java/fr/pasteur/ida/zellige/gui/controller/BatchModeDialog.java index 1a8e28c714ed16c234116acce46944ba01495db9..6d003131c410e1755e41ff2ce0d903a8fb8d04d3 100644 --- a/src/main/java/fr/pasteur/ida/zellige/gui/controller/BatchModeDialog.java +++ b/src/main/java/fr/pasteur/ida/zellige/gui/controller/BatchModeDialog.java @@ -5,6 +5,7 @@ import fr.pasteur.ida.zellige.ReferenceSurfaceExtraction; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; +import javafx.scene.control.Button; import javafx.scene.control.TextField; import javafx.scene.layout.VBox; import javafx.stage.FileChooser; @@ -15,8 +16,16 @@ import java.io.IOException; import java.net.URL; import java.util.ResourceBundle; -public class BatchModeDialog extends VBox +public class BatchModeDialog extends VBox implements Initializable { + @FXML + private Button browse; + + @FXML + private TextField filePathField; // TextField to display selected file path + + @FXML + private Button run; public BatchModeDialog() { @@ -35,8 +44,7 @@ public class BatchModeDialog extends VBox } } - @FXML - private TextField filePathField; // TextField to display selected file path + private File selectedFile; // Store the selected file @@ -73,4 +81,20 @@ public class BatchModeDialog extends VBox } + @Override + public void initialize( URL url, ResourceBundle resourceBundle ) + { + browse.setOnAction(e -> handleBrowse()); + run.setOnAction( e-> + { + try + { + handleRun(); + } + catch ( Exception ex ) + { + throw new RuntimeException( ex ); + } + } ); + } } diff --git a/src/main/resources/fr.pasteur.ida.zellige.gui.view/BatchModeDialog.fxml b/src/main/resources/fr.pasteur.ida.zellige.gui.view/BatchModeDialog.fxml index a6bec8b8928751acc06513662bbd0c59c722bc7b..f8a0583929ee4d2bc8597c183cbc7758c4288139 100644 --- a/src/main/resources/fr.pasteur.ida.zellige.gui.view/BatchModeDialog.fxml +++ b/src/main/resources/fr.pasteur.ida.zellige.gui.view/BatchModeDialog.fxml @@ -7,22 +7,18 @@ <?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.VBox?> -<fx:root alignment="CENTER" prefHeight="151.0" prefWidth="439.0" spacing="10" type="VBox" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" > +<fx:root alignment="CENTER" prefHeight="151.0" prefWidth="439.0" spacing="10" type="VBox" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1"> <Label text="Select a File" /> <HBox prefHeight="26.0" prefWidth="399.0" spacing="10"> <TextField fx:id="filePathField" editable="false" prefWidth="300" /> - <Button text="Browse" > - <onAction>#handleBrowse</onAction> - </Button> + <Button fx:id="browse" text="Browse" /> <padding> <Insets left="10.0" right="10.0" /> </padding> </HBox> - <Button text="Run" > - <onAction>#handleRun</onAction> - </Button> + <Button fx:id="run" text="Run" /> </fx:root>