Package com.jme3.app.state
Class AbstractAppState
java.lang.Object
com.jme3.app.state.AbstractAppState
- All Implemented Interfaces:
- AppState
- Direct Known Subclasses:
- AWTComponentAppState,- BulletAppState,- BulletDebugAppState,- ChaseCameraAppState,- DebugKeysAppState,- FlyCamAppState,- MaterialDebugAppState,- ResetStatsState,- RootNodeAppState,- ScreenshotAppState,- StatsAppState,- VideoRecorderAppState,- VRAppState
AbstractAppState implements some common methods
 that make creation of AppStates easier.- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected booleaninitializedis set to true when the methodinitialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application)is called.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcleanup()Called byAppStateManagerwhen transitioning thisAppStatefrom terminating to detached.getId()Returns the unique ID for this AppState or null if it has no unique ID.voidinitialize(AppStateManager stateManager, Application app) Called byAppStateManagerwhen transitioning thisAppStatefrom initializing to running.
 This will happen on the next iteration through the update loop afterAppStateManager.attach(com.jme3.app.state.AppState)was called.booleanbooleanvoidCalled after all rendering commands are flushed.voidrender(RenderManager rm) Render the state.voidsetEnabled(boolean enabled) Enable or disable the functionality of theAppState.protected voidSets the unique ID of this app state.voidstateAttached(AppStateManager stateManager) Called byAppStateManager.attach(com.jme3.app.state.AppState)when transitioning thisAppStatefrom detached to initializing.voidstateDetached(AppStateManager stateManager) Called byAppStateManager.detach(com.jme3.app.state.AppState)when transitioning thisAppStatefrom running to terminating.voidupdate(float tpf) Called to update theAppState.
- 
Field Details- 
initializedprotected boolean initializedinitializedis set to true when the methodinitialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application)is called. Whencleanup()is called,initializedis set back to false.
 
- 
- 
Constructor Details- 
AbstractAppStateprotected AbstractAppState()
- 
AbstractAppState
 
- 
- 
Method Details- 
initializeDescription copied from interface:AppStateCalled byAppStateManagerwhen transitioning thisAppStatefrom initializing to running.
 This will happen on the next iteration through the update loop afterAppStateManager.attach(com.jme3.app.state.AppState)was called.AppStateManagerwill call this only from the update loop inside the rendering thread. This means is it safe to modify the scene graph from this method.- Specified by:
- initializein interface- AppState
- Parameters:
- stateManager- The state manager
- app- The application
 
- 
isInitializedpublic boolean isInitialized()- Specified by:
- isInitializedin interface- AppState
- Returns:
- True if initialize()was called on the state, false otherwise.
 
- 
setIdSets the unique ID of this app state. Note: that setting this while an app state is attached to the state manager will have no effect on ID-based lookups.- Parameters:
- id- the desired ID
 
- 
getIdDescription copied from interface:AppStateReturns the unique ID for this AppState or null if it has no unique ID.
- 
setEnabledpublic void setEnabled(boolean enabled) Description copied from interface:AppStateEnable or disable the functionality of theAppState. The effect of this call depends on implementation. AnAppStatestarts as being enabled by default. A disabledAppStates does not get calls toAppState.update(float),AppState.render(RenderManager), orAppState.postRender()from itsAppStateManager.- Specified by:
- setEnabledin interface- AppState
- Parameters:
- enabled- activate the AppState or not.
 
- 
isEnabledpublic boolean isEnabled()
- 
stateAttachedDescription copied from interface:AppStateCalled byAppStateManager.attach(com.jme3.app.state.AppState)when transitioning thisAppStatefrom detached to initializing.There is no assumption about the thread from which this function is called, therefore it is unsafe to modify the scene graph from this method. Please use AppState.initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application)instead.- Specified by:
- stateAttachedin interface- AppState
- Parameters:
- stateManager- State manager to which the state was attached to.
 
- 
stateDetachedDescription copied from interface:AppStateCalled byAppStateManager.detach(com.jme3.app.state.AppState)when transitioning thisAppStatefrom running to terminating.There is no assumption about the thread from which this function is called, therefore it is unsafe to modify the scene graph from this method. Please use AppState.cleanup()instead.- Specified by:
- stateDetachedin interface- AppState
- Parameters:
- stateManager- The state manager from which the state was detached from.
 
- 
updatepublic 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.
- 
renderDescription copied from interface:AppStateRender the state. This method will be called every render pass if theAppStateis both attached and enabled.
- 
postRenderpublic void postRender()Description copied from interface:AppStateCalled after all rendering commands are flushed. This method will be called every render pass if theAppStateis both attached and enabled.- Specified by:
- postRenderin interface- AppState
 
- 
cleanuppublic void cleanup()Description copied from interface:AppStateCalled byAppStateManagerwhen transitioning thisAppStatefrom terminating to detached. This method is called the following render pass after theAppStatehas been detached and is always called once and only once for each timeinitialize()is called. Either when theAppStateis detached or when the application terminates (if it terminates normally).
 
-