com.jme3.app.state
Class AbstractAppState

java.lang.Object
  extended by com.jme3.app.state.AbstractAppState
All Implemented Interfaces:
AppState
Direct Known Subclasses:
DebugKeysAppState, FlyCamAppState, ResetStatsState, ScreenshotAppState, StatsAppState, VideoRecorderAppState

public class AbstractAppState
extends java.lang.Object
implements AppState

AbstractAppState implements some common methods that make creation of AppStates easier.


Field Summary
protected  boolean initialized
          initialized is set to true when the method initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application) is called.
 
Constructor Summary
AbstractAppState()
           
 
Method Summary
 void cleanup()
          Cleanup the game state.
 void initialize(AppStateManager stateManager, Application app)
          Called to initialize the AppState.
 boolean isEnabled()
           
 boolean isInitialized()
           
 void postRender()
          Called after all rendering commands are flushed.
 void render(RenderManager rm)
          Render the state.
 void setEnabled(boolean enabled)
          Enable or disable the functionality of the AppState.
 void stateAttached(AppStateManager stateManager)
          Called when the state was attached.
 void stateDetached(AppStateManager stateManager)
          Called when the state was detached.
 void update(float tpf)
          Called to update the state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initialized

protected boolean initialized
initialized is set to true when the method initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application) is called. When cleanup() is called, initialized is set back to false.

Constructor Detail

AbstractAppState

public AbstractAppState()
Method Detail

initialize

public void initialize(AppStateManager stateManager,
                       Application app)
Description copied from interface: AppState
Called to initialize the AppState.

Specified by:
initialize in interface AppState
Parameters:
stateManager - The state manager

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface AppState
Returns:
True if initialize() was called on the state, false otherwise.

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: AppState
Enable or disable the functionality of the AppState. The effect of this call depends on implementation. An AppState starts as being enabled by default.

Specified by:
setEnabled in interface AppState
Parameters:
enabled - activate the AppState or not.

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface AppState
Returns:
True if the AppState is enabled, false otherwise.
See Also:
AppState.setEnabled(boolean)

stateAttached

public void stateAttached(AppStateManager stateManager)
Description copied from interface: AppState
Called when the state was attached.

Specified by:
stateAttached in interface AppState
Parameters:
stateManager - State manager to which the state was attached to.

stateDetached

public void stateDetached(AppStateManager stateManager)
Description copied from interface: AppState
Called when the state was detached.

Specified by:
stateDetached in interface AppState
Parameters:
stateManager - The state manager from which the state was detached from.

update

public void update(float tpf)
Description copied from interface: AppState
Called to update the state.

Specified by:
update in interface AppState
Parameters:
tpf - Time per frame.

render

public void render(RenderManager rm)
Description copied from interface: AppState
Render the state.

Specified by:
render in interface AppState
Parameters:
rm - RenderManager

postRender

public void postRender()
Description copied from interface: AppState
Called after all rendering commands are flushed.

Specified by:
postRender in interface AppState

cleanup

public void cleanup()
Description copied from interface: AppState
Cleanup the game state.

Specified by:
cleanup in interface AppState