Class FocusNavigationState

java.lang.Object
com.jme3.app.state.BaseAppState
com.simsilica.lemur.focus.FocusNavigationState
All Implemented Interfaces:
AppState

public class FocusNavigationState extends BaseAppState
Manages the input based UI navigation and maybe some minimal input hookups.
  • Constructor Details Link icon

  • Method Details Link icon

    • getDefaultFocus Link icon

      public Spatial getDefaultFocus(Spatial spatial)
      Returns the default focus element for the specified spatial if it is a focus container, else it returns the spatial directly.
    • requestChangeFocus Link icon

      public Spatial requestChangeFocus(Spatial spatial, FocusTraversal.TraversalDirection dir)
      Attempts to navigate to the next focusable element as specified by the traversal direction.
    • initialize Link icon

      protected void initialize(Application app)
      Description copied from class: BaseAppState
      Called during initialization once the app state is attached and before onEnable() is called.
      Specified by:
      initialize in class BaseAppState
      Parameters:
      app - the application
    • cleanup Link icon

      protected void cleanup(Application app)
      Description copied from class: BaseAppState
      Called after the app state is detached or during application shutdown if the state is still attached. onDisable() is called before this cleanup() method if the state is enabled at the time of cleanup.
      Specified by:
      cleanup in class BaseAppState
      Parameters:
      app - the application
    • onEnable Link icon

      protected void onEnable()
      Description copied from class: BaseAppState
      Called when the state is fully enabled, ie: is attached and isEnabled() is true or when the setEnabled() status changes after the state is attached.
      Specified by:
      onEnable in class BaseAppState
    • onDisable Link icon

      protected void onDisable()
      Description copied from class: BaseAppState
      Called when the state was previously enabled but is now disabled either because setEnabled(false) was called or the state is being cleaned up.
      Specified by:
      onDisable in class BaseAppState
    • getCurrentFocus Link icon

      protected Spatial getCurrentFocus()
    • getControl Link icon

      protected static <T> T getControl(Spatial s, Class<T> type)
      Utillity method to get the control for a spatial when we don't care if the interface implements control.
    • getFocusTraversal Link icon

      public static FocusTraversal getFocusTraversal(Spatial s)
    • getFocusContainer Link icon

      protected Spatial getFocusContainer(Spatial spatial)