Package io.tlf.jme.jfx
Class JavaFxUI
- java.lang.Object
-
- io.tlf.jme.jfx.JavaFxUI
-
public class JavaFxUI extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattachChild(javafx.scene.Node node)Attach a javafx.scene.Node to the GUI scene.voiddetachChild(java.lang.String fxId)Detach a node from the GUI scene.voiddetachChild(javafx.scene.Node node)Detach a node from the GUI scene.javafx.scene.NodegetChild(java.lang.String fxId)Get a control from the scene with the given fx:idjavafx.scene.GroupgetGroup()static JavaFxUIgetInstance()JmeFxContainergetJmeFxContainer()Get the JmeFxContainer that is being used to manage Jfx with Jme.javafx.scene.ScenegetScene()voidgrabFocus()Set the input focus to JavaFx.static voidinitialize(com.jme3.app.Application application, java.lang.String... cssStyles)Initializes the JavaFxUI class ready for use.voidloseFocus()Set the input focus to JME.voidremoveAllChildren()Removes all children from the GUI scene.voidremoveDialog()Removes the shown dialog from the scene.voidrunInJavaFxThread(java.lang.Runnable task)Execute a task on the JavaFX thread.voidrunInJmeThread(java.lang.Runnable task)Execute a task on the Jmonkey GL thread.static voidsetInstallAdapter(boolean installAdapter)voidshowDialog(javafx.scene.Node node)Display a javafx.scene.Node as a centered dialog.voidshowDialog(javafx.scene.Node node, boolean dimmed)Display a javafx.scene.Node as a centered dialog.
-
-
-
Method Detail
-
initialize
public static void initialize(com.jme3.app.Application application, java.lang.String... cssStyles)Initializes the JavaFxUI class ready for use. This initialization must be called first before this class is ready for use.- Parameters:
application- the Jmonkey Application.cssStyles- The global css stylesheets.
-
setInstallAdapter
public static void setInstallAdapter(boolean installAdapter)
-
getInstance
public static JavaFxUI getInstance()
-
getGroup
public javafx.scene.Group getGroup()
-
getScene
public javafx.scene.Scene getScene()
-
grabFocus
public void grabFocus()
Set the input focus to JavaFx.
-
loseFocus
public void loseFocus()
Set the input focus to JME.
-
attachChild
public void attachChild(javafx.scene.Node node)
Attach a javafx.scene.Node to the GUI scene.- Parameters:
node- the node to attach to the scene.
-
detachChild
public void detachChild(javafx.scene.Node node)
Detach a node from the GUI scene.- Parameters:
node- the node to detach from the scene.
-
detachChild
public void detachChild(java.lang.String fxId)
Detach a node from the GUI scene.- Parameters:
fxId- the fx:id of the node.
-
getChild
public javafx.scene.Node getChild(java.lang.String fxId)
Get a control from the scene with the given fx:id- Parameters:
fxId- the String fx:id if the node.- Returns:
- the node with the given name, or null if the node was not found.
-
removeAllChildren
public void removeAllChildren()
Removes all children from the GUI scene.
-
showDialog
public void showDialog(javafx.scene.Node node)
Display a javafx.scene.Node as a centered dialog. A dimmed background will be drawn behind the node and any click events will be ignored on GUI items behind it.- Parameters:
node- the node to display as a dialog.
-
showDialog
public void showDialog(javafx.scene.Node node, boolean dimmed)Display a javafx.scene.Node as a centered dialog. A dimmed or transparent background will be drawn behind the node and any click events will be ignored on GUI items behind it.- Parameters:
node- the node to display as a dialog.dimmed- whether or not to dim the scene behind the given node.
-
removeDialog
public void removeDialog()
Removes the shown dialog from the scene.
-
runInJavaFxThread
public void runInJavaFxThread(java.lang.Runnable task)
Execute a task on the JavaFX thread.- Parameters:
task- the task to execute.
-
runInJmeThread
public void runInJmeThread(java.lang.Runnable task)
Execute a task on the Jmonkey GL thread.- Parameters:
task- the task to execute.
-
getJmeFxContainer
public JmeFxContainer getJmeFxContainer()
Get the JmeFxContainer that is being used to manage Jfx with Jme.- Returns:
- the current implementation of JmeFxContainer in use.
-
-