Class JavaFxUI


  • public class JavaFxUI
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void attachChild​(javafx.scene.Node node)
      Attach a javafx.scene.Node to the GUI scene.
      void detachChild​(java.lang.String fxId)
      Detach a node from the GUI scene.
      void detachChild​(javafx.scene.Node node)
      Detach a node from the GUI scene.
      javafx.scene.Node getChild​(java.lang.String fxId)
      Get a control from the scene with the given fx:id
      javafx.scene.Group getGroup()  
      static JavaFxUI getInstance()  
      JmeFxContainer getJmeFxContainer()
      Get the JmeFxContainer that is being used to manage Jfx with Jme.
      javafx.scene.Scene getScene()  
      void grabFocus()
      Set the input focus to JavaFx.
      static void initialize​(com.jme3.app.Application application, java.lang.String... cssStyles)
      Initializes the JavaFxUI class ready for use.
      void loseFocus()
      Set the input focus to JME.
      void removeAllChildren()
      Removes all children from the GUI scene.
      void removeDialog()
      Removes the shown dialog from the scene.
      void runInJavaFxThread​(java.lang.Runnable task)
      Execute a task on the JavaFX thread.
      void runInJmeThread​(java.lang.Runnable task)
      Execute a task on the Jmonkey GL thread.
      static void setInstallAdapter​(boolean installAdapter)  
      void showDialog​(javafx.scene.Node node)
      Display a javafx.scene.Node as a centered dialog.
      void showDialog​(javafx.scene.Node node, boolean dimmed)
      Display a javafx.scene.Node as a centered dialog.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.