From 219af0f9f4dbfac8cc1a2a8dd39735fdb51d33ef Mon Sep 17 00:00:00 2001 From: "Zer..om" Date: Fri, 16 Nov 2012 14:57:44 +0000 Subject: [PATCH] Updated AppState Javadoc. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9999 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/core/com/jme3/app/state/AppState.java | 53 +++++++++++++++---- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/engine/src/core/com/jme3/app/state/AppState.java b/engine/src/core/com/jme3/app/state/AppState.java index fb31dddac..34af8906a 100644 --- a/engine/src/core/com/jme3/app/state/AppState.java +++ b/engine/src/core/com/jme3/app/state/AppState.java @@ -35,24 +35,46 @@ import com.jme3.app.Application; import com.jme3.renderer.RenderManager; /** - * AppState represents a continously executing code inside the main loop. + * AppState represents continously executing code inside the main loop. + * * An AppState can track when it is attached to the - * {@link AppStateManager} or when it is detached.
AppStates - * are initialized in the render thread, upon a call to {@link AppState#initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application) } + * {@link AppStateManager} or when it is detached. + * + *
AppStates are initialized in the render thread, upon a call to + * {@link AppState#initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application) } * and are de-initialized upon a call to {@link AppState#cleanup()}. * Implementations should return the correct value with a call to * {@link AppState#isInitialized() } as specified above.
* - * + * * @author Kirill Vainer */ public interface AppState { /** - * Called to initialize the AppState. + * Called to initialize the AppState. This method is called + * in the next render pass after the AppState is attached. * * @param stateManager The state manager - * @param app + * @param app The application */ public void initialize(AppStateManager stateManager, Application app); @@ -77,22 +99,28 @@ public interface AppState { * @see AppState#setEnabled(boolean) */ public boolean isEnabled(); + /** - * Called when the state was attached. + * Called when the state was attached. Most implementations should do little + * or nothing in this method. In particular any scene graph changes need to + * be made in initialize(). * * @param stateManager State manager to which the state was attached to. */ public void stateAttached(AppStateManager stateManager); /** - * Called when the state was detached. + * Called when the state was detached. Most implementations should do little + * or nothing in this method. In particular any scene graph changes need to + * be made in cleanup(). * * @param stateManager The state manager from which the state was detached from. */ public void stateDetached(AppStateManager stateManager); /** - * Called to update the state. + * Called to update the AppState. This method will be called + * every render pass if the AppState is both attached and enabled. * * @param tpf Time per frame. */ @@ -111,7 +139,12 @@ public interface AppState { public void postRender(); /** - * Cleanup the game state. + * Called to clean up the AppState after it has been removed. This + * method is called the following render pass after the AppState has + * been detached and is always called once and only once for each time + * initialize() is called. Either when the AppState + * is detached or when the application terminates (if it terminates normally). + * */ public void cleanup();