Skip to content
Snippets Groups Projects
Commit b517ad5f authored by Céline  TREBEAU's avatar Céline TREBEAU
Browse files

Feature : batch mode

parent 077e0390
No related branches found
No related tags found
2 merge requests!47Feature : Multi-channel and Binning,!41Resolve "Consider rescaling (binning) large images"
...@@ -5,6 +5,7 @@ import fr.pasteur.ida.zellige.ReferenceSurfaceExtraction; ...@@ -5,6 +5,7 @@ import fr.pasteur.ida.zellige.ReferenceSurfaceExtraction;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable; import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.scene.layout.VBox; import javafx.scene.layout.VBox;
import javafx.stage.FileChooser; import javafx.stage.FileChooser;
...@@ -15,8 +16,16 @@ import java.io.IOException; ...@@ -15,8 +16,16 @@ import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.ResourceBundle; 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() public BatchModeDialog()
{ {
...@@ -35,8 +44,7 @@ public class BatchModeDialog extends VBox ...@@ -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 private File selectedFile; // Store the selected file
...@@ -73,4 +81,20 @@ public class BatchModeDialog extends VBox ...@@ -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 );
}
} );
}
} }
...@@ -7,22 +7,18 @@ ...@@ -7,22 +7,18 @@
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?> <?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" /> <Label text="Select a File" />
<HBox prefHeight="26.0" prefWidth="399.0" spacing="10"> <HBox prefHeight="26.0" prefWidth="399.0" spacing="10">
<TextField fx:id="filePathField" editable="false" prefWidth="300" /> <TextField fx:id="filePathField" editable="false" prefWidth="300" />
<Button text="Browse" > <Button fx:id="browse" text="Browse" />
<onAction>#handleBrowse</onAction>
</Button>
<padding> <padding>
<Insets left="10.0" right="10.0" /> <Insets left="10.0" right="10.0" />
</padding> </padding>
</HBox> </HBox>
<Button text="Run" > <Button fx:id="run" text="Run" />
<onAction>#handleRun</onAction>
</Button>
</fx:root> </fx:root>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment