Package com.simsilica.lemur.focus
Class FocusManagerState
java.lang.Object
com.jme3.app.state.BaseAppState
com.simsilica.lemur.focus.FocusManagerState
- All Implemented Interfaces:
AppState
AppState that manages the focus transition between
one FocusTarget and another.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcleanup(Application app) Called after the app state is detached or during application shutdown if the state is still attached.static FocusTargetgetFocus()protected voidinitialize(Application app) Called during initialization once the app state is attached and before onEnable() is called.protected booleanisConnected(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.protected voidCalled when the state was previously enabled but is now disabled either because setEnabled(false) was called or the state is being cleaned up.protected voidonEnable()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.booleanreleaseFocus(Spatial focus) Clears the current focus if the specified spatial is still in the current focus chain.voidvoidsetFocusNavigationState(FocusNavigationState focusNavigationState) voidupdate(float tpf) Called to update theAppState.protected voidMethods inherited from class com.jme3.app.state.BaseAppState
cleanup, getApplication, getId, getState, getState, getState, getState, getStateManager, initialize, isEnabled, isInitialized, postRender, render, setEnabled, setId, stateAttached, stateDetached
-
Constructor Details
-
FocusManagerState
public FocusManagerState()
-
-
Method Details
-
findFocusTarget
-
setFocus
-
releaseFocus
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
-
initialize
Description copied from class:BaseAppStateCalled during initialization once the app state is attached and before onEnable() is called.- Specified by:
initializein classBaseAppState- Parameters:
app- the application
-
cleanup
Description copied from class:BaseAppStateCalled 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:
cleanupin classBaseAppState- Parameters:
app- the application
-
update
public void update(float tpf) Description copied from interface:AppStateCalled to update theAppState. This method will be called every render pass if theAppStateis both attached and enabled.- Specified by:
updatein interfaceAppState- Overrides:
updatein classBaseAppState- Parameters:
tpf- Time since the last call to update(), in seconds.
-
getHierarchy
-
isConnected
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:BaseAppStateCalled 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:
onEnablein classBaseAppState
-
onDisable
protected void onDisable()Description copied from class:BaseAppStateCalled 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:
onDisablein classBaseAppState
-