BakeoutController  0.1
A Controller for the Omicron vacuum chamber
SequenceController.java
1 package ui.controllers;
2 
3 import javafx.fxml.FXML;
4 import javafx.stage.Window;
5 import org.springframework.beans.factory.annotation.Autowired;
7 import ui.Controller;
8 import ui.FXMLLoader;
9 import ui.FXMLStage;
10 
11 import javax.annotation.PostConstruct;
12 import java.io.IOException;
13 import java.net.URL;
14 
18 @Controller
19 public class SequenceController {
23  private final URL newStepFormLocation = getClass().getResource(
24  "/modals/NewStep.fxml"
25  );
26 
30  private FXMLStage newStepFormStage;
31 
35  @Autowired
36  private FXMLStage applicationStage;
37 
41  @Autowired
42  private FXMLLoader fxmlLoader;
43 
44  @PostConstruct
45  public void setUp() throws IOException {
46  configureNewStepFormStage();
47  }
48 
49  @FXML public void displayNewStepForm(){
50  newStepFormStage.show();
51  }
52 
53  private void configureNewStepFormStage() throws IOException {
54  newStepFormStage = new AutowiredFXMLStage(
55  newStepFormLocation, castStageToWindow(applicationStage)
56  );
57  newStepFormStage.setFXMLLoader(fxmlLoader);
58  newStepFormStage.loadFXML();
59  }
60 
61  private static Window castStageToWindow(FXMLStage stage){
62  return (Window) stage;
63  }
64 }
void loadFXML()
void setFXMLLoader(FXMLLoader loader)
Git Repo