gets the stage associated with the debug dialog. must be synchronized as it inits primaryStage.
()
| 48 | * must be synchronized as it inits primaryStage. |
| 49 | */ |
| 50 | private static synchronized Stage getStage() |
| 51 | { |
| 52 | GuiAssertions.assertIsJavaFXThread(); |
| 53 | if (primaryStage != null) |
| 54 | { |
| 55 | return primaryStage; |
| 56 | } |
| 57 | FXMLLoader loader = new FXMLLoader(); |
| 58 | loader.setResources(LanguageBundle.getBundle()); |
| 59 | loader.setLocation(DebugDialog.class.getResource("DebugDialog.fxml")); |
| 60 | primaryStage = new Stage(); |
| 61 | final Scene scene; |
| 62 | try |
| 63 | { |
| 64 | scene = loader.load(); |
| 65 | } |
| 66 | catch (IOException e) |
| 67 | { |
| 68 | Logging.errorPrint("failed to load debugdialog", e); |
| 69 | // this can only happen with invalid fxml above and can't actually happen in real life |
| 70 | throw new RuntimeException(e); |
| 71 | } |
| 72 | primaryStage.setScene(scene); |
| 73 | DebugDialogController controller = loader.getController(); |
| 74 | primaryStage.setOnShown(e -> controller.initTimer()); |
| 75 | return primaryStage; |
| 76 | } |
| 77 | |
| 78 | public static void show() |
| 79 | { |
no test coverage detected