Class FocusManagerState

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

public class FocusManagerState extends BaseAppState
AppState that manages the focus transition between one FocusTarget and another.
  • Constructor Details

    • FocusManagerState

      public FocusManagerState()
  • Method Details

    • findFocusTarget

      public static FocusTarget findFocusTarget(Spatial s)
    • setFocusNavigationState

      public void setFocusNavigationState(FocusNavigationState focusNavigationState)
    • getFocusNavigationState

      public FocusNavigationState getFocusNavigationState()
    • setFocus

      public void setFocus(Spatial focus)
    • releaseFocus

      public boolean releaseFocus(Spatial focus)
      Clears the current focus if the specified spatial is still in the current focus chain. Returns true if the focus was actually changed as a result of this call.
    • getFocus

      public Spatial getFocus()
    • initialize

      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

      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
    • update

      public void update(float tpf)
      Description copied from interface: AppState
      Called to update the AppState. This method will be called every render pass if the AppState is both attached and enabled.
      Specified by:
      update in interface AppState
      Overrides:
      update in class BaseAppState
      Parameters:
      tpf - Time since the last call to update(), in seconds.
    • getHierarchy

      protected List<Spatial> getHierarchy(Spatial s)
    • isConnected

      protected boolean isConnected(List<Spatial> hierarchy)
      Returns true if the specified hierarchy list is still as fully connected as it was when original set, meaning that all spatials except the first still have valid parents that are also the previous item in the list.
    • updateFocusHierarchy

      protected void updateFocusHierarchy()
    • onEnable

      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

      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