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

Method wrapParentAsJFXPanel

code/src/java/pcgen/gui3/GuiUtility.java:43–52  ·  view source on GitHub ↗

During the conversion to JavaFX we have a mix of JavaFX and Swing components This provides a way to convert from JavaFX to Swing. Note that the painting happens "eventually" and thus when the function returned there is no guarantee that the component has any size yet. @param parent a javafx Parent t

(Parent parent)

Source from the content-addressed store, hash-verified

41 * @return a jfxpanel that eventually gets painted as the parent container
42 */
43 public static JFXPanel wrapParentAsJFXPanel(Parent parent)
44 {
45 GuiAssertions.assertIsNotJavaFXThread();
46 JFXPanel jfxPanel = new JFXPanel();
47 Platform.runLater(() -> {
48 Scene scene = new Scene(parent);
49 jfxPanel.setScene(scene);
50 });
51 return jfxPanel;
52 }
53
54 public static <T> T runOnJavaFXThreadNow(Supplier<T> supplier)
55 {

Callers 15

initComponentsMethod · 0.95
PCGenStatusBarMethod · 0.95
CharacterStatsPanelMethod · 0.95
LocationPanelMethod · 0.95
initComponentsMethod · 0.95
HouseRulesPanelMethod · 0.95
LanguagePanelMethod · 0.95
OutputPanelMethod · 0.95
CharacterSheetInfoTabMethod · 0.95
JDynamicTableMethod · 0.95
JTreeViewTableMethod · 0.95
initComponentsMethod · 0.95

Calls 1

Tested by

no test coverage detected