diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/NewJobController.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/NewJobController.java new file mode 100644 index 0000000000000000000000000000000000000000..2631710eacb6be38d1be30a8342a7fb9972ba00c --- /dev/null +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/NewJobController.java @@ -0,0 +1,48 @@ +package cz.it4i.fiji.haas_spim_benchmark.ui; + +import java.awt.Window; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import cz.it4i.fiji.haas.ui.CloseableControl; +import cz.it4i.fiji.haas.ui.InitiableControl; +import cz.it4i.fiji.haas.ui.JavaFXRoutines; +import javafx.fxml.FXML; +import javafx.scene.control.Button; +import javafx.scene.layout.BorderPane; + +public class NewJobController extends BorderPane implements CloseableControl, InitiableControl { + @SuppressWarnings("unused") + private static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas_spim_benchmark.ui.NewJobController.class); + + @FXML + private Button btnCreate; + + private boolean create = false; + + private Window ownerWindow; + + public NewJobController() { + JavaFXRoutines.initRootAndController("NewJobView.fxml", this); + getStylesheets().add(getClass().getResource("NewJobView.css").toExternalForm()); + btnCreate.setOnMouseClicked(X -> createPressed()); + } + + private void createPressed() { + create = true; + ownerWindow.setVisible(false); + ownerWindow.dispose(); + } + + @Override + public void close() { + log.info("close"); + } + + @Override + public void init(Window parameter) { + ownerWindow = parameter; + } + +} diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/NewJobView.fxml b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/NewJobView.fxml index 6c68c44d47867bbfea76622e1a7f68cfc9a1f84b..41c00072e9e19c9dd0b7309ee1c6237ea065a5aa 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/NewJobView.fxml +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/NewJobView.fxml @@ -12,7 +12,7 @@ <?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.VBox?> -<fx:root maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" type="BorderPane" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1"> +<fx:root maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" type="BorderPane" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="cz.it4i.fiji.haas_spim_benchmark.ui.NewJobController"> <center> <VBox BorderPane.alignment="CENTER"> <children> @@ -95,7 +95,7 @@ <bottom> <BorderPane BorderPane.alignment="CENTER"> <right> - <Button mnemonicParsing="false" prefHeight="22.0" prefWidth="71.0" text="Start" BorderPane.alignment="CENTER"> + <Button fx:id="btnCreate" mnemonicParsing="false" prefHeight="22.0" prefWidth="71.0" text="Start" BorderPane.alignment="CENTER"> <BorderPane.margin> <Insets right="3.0" /> </BorderPane.margin></Button> diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/NewJobWindow.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/NewJobWindow.java new file mode 100644 index 0000000000000000000000000000000000000000..102f5f432d09503f2baabd0848a76b7cf27ef068 --- /dev/null +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/ui/NewJobWindow.java @@ -0,0 +1,22 @@ +package cz.it4i.fiji.haas_spim_benchmark.ui; + +import java.awt.Window; +import java.io.IOException; + +import cz.it4i.fiji.haas.ui.FXFrame; + +public class NewJobWindow extends FXFrame<NewJobController>{ + + private static final long serialVersionUID = 1L; + + + + public NewJobWindow(Window parentWindow) throws IOException { + super(parentWindow,()->{ + return new NewJobController(); + + }); + setTitle("Create job"); + } + +} \ No newline at end of file diff --git a/haas-spim-benchmark/src/test/java/cz/it4i/fiji/haas/NewJobWindowShow.java b/haas-spim-benchmark/src/test/java/cz/it4i/fiji/haas/NewJobWindowShow.java new file mode 100644 index 0000000000000000000000000000000000000000..525b110ddbb9e0078993902b8c67bbb0e88cf03e --- /dev/null +++ b/haas-spim-benchmark/src/test/java/cz/it4i/fiji/haas/NewJobWindowShow.java @@ -0,0 +1,11 @@ +package cz.it4i.fiji.haas; + +import java.io.IOException; + +import cz.it4i.fiji.haas_spim_benchmark.ui.NewJobWindow; + +public class NewJobWindowShow { + public static void main(String[] args) throws IOException { + new NewJobWindow(null).setVisible(true); + } +}