MCPcopy Create free account
hub / github.com/PCGen/pcgen / getStage

Method getStage

code/src/java/pcgen/gui3/dialog/DebugDialog.java:50–76  ·  view source on GitHub ↗

gets the stage associated with the debug dialog. must be synchronized as it inits primaryStage.

()

Source from the content-addressed store, hash-verified

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 {

Callers 1

showMethod · 0.95

Calls 7

assertIsJavaFXThreadMethod · 0.95
getBundleMethod · 0.95
errorPrintMethod · 0.95
initTimerMethod · 0.95
getControllerMethod · 0.65
setLocationMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected