Skip to content
Snippets Groups Projects
Commit 8cade5e0 authored by Jan Kožusznik's avatar Jan Kožusznik
Browse files

basic logic

parent fade49f0
No related branches found
No related tags found
No related merge requests found
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;
}
}
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<?import javafx.scene.layout.HBox?> <?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?> <?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> <center>
<VBox BorderPane.alignment="CENTER"> <VBox BorderPane.alignment="CENTER">
<children> <children>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<bottom> <bottom>
<BorderPane BorderPane.alignment="CENTER"> <BorderPane BorderPane.alignment="CENTER">
<right> <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> <BorderPane.margin>
<Insets right="3.0" /> <Insets right="3.0" />
</BorderPane.margin></Button> </BorderPane.margin></Button>
......
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
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);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment