com.jme3.app
Class SimpleApplication

java.lang.Object
  extended by com.jme3.app.Application
      extended by com.jme3.app.SimpleApplication
All Implemented Interfaces:
SystemListener
Direct Known Subclasses:
SimpleSoundTest, SimpleTexturedTest, TestAmbient, TestBumpModel, TestMovingParticle, TestNormalMapping, TestSkyLoadingLagoon, TestSkyLoadingPrimitives, TestUnshadedModel

public abstract class SimpleApplication
extends Application

SimpleApplication extends the Application class to provide default functionality like a first-person camera, and an accessible root node that is updated and rendered regularly. Additionally, SimpleApplication will display a statistics view using the StatsView class. It will display the current frames-per-second value on-screen in addition to the statistics. Several keys have special functionality in SimpleApplication:

Esc- Close the application
C- Display the camera position and rotation in the console.
M- Display memory usage in the console.


Field Summary
protected  FlyByCamera flyCam
           
protected  BitmapText fpsText
           
protected  BitmapFont guiFont
           
protected  Node guiNode
           
static java.lang.String INPUT_MAPPING_CAMERA_POS
           
static java.lang.String INPUT_MAPPING_EXIT
           
static java.lang.String INPUT_MAPPING_HIDE_STATS
           
static java.lang.String INPUT_MAPPING_MEMORY
           
protected  Node rootNode
           
protected  boolean showSettings
           
 
Fields inherited from class com.jme3.app.Application
assetManager, audioRenderer, cam, context, guiViewPort, inputEnabled, inputManager, joyInput, keyInput, listener, mouseInput, paused, pauseOnFocus, renderer, renderManager, settings, speed, stateManager, timer, touchInput, viewPort
 
Constructor Summary
SimpleApplication()
           
SimpleApplication(AppState... initialStates)
           
 
Method Summary
 FlyByCamera getFlyByCamera()
          Retrieves flyCam
 Node getGuiNode()
          Retrieves guiNode
 Node getRootNode()
          Retrieves rootNode
 void initialize()
          Do not call manually.
 boolean isShowSettings()
           
protected  BitmapFont loadGuiFont()
          Creates the font that will be set to the guiFont field and subsequently set as the font for the stats text.
 void setDisplayFps(boolean show)
           
 void setDisplayStatView(boolean show)
           
 void setShowSettings(boolean showSettings)
          Toggles settings window to display at start-up
abstract  void simpleInitApp()
           
 void simpleRender(RenderManager rm)
           
 void simpleUpdate(float tpf)
           
 void start()
          Starts the application in display mode.
 void update()
          Do not call manually.
 
Methods inherited from class com.jme3.app.Application
createCanvas, destroy, destroyInput, enqueue, gainFocus, getAssetManager, getAudioRenderer, getCamera, getContext, getGuiViewPort, getInputManager, getListener, getRenderer, getRenderManager, getStateManager, getTimer, getViewPort, handleError, isPauseOnLostFocus, loseFocus, requestClose, reshape, restart, runQueuedTasks, setAssetManager, setPauseOnLostFocus, setSettings, setTimer, start, startCanvas, startCanvas, stop, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INPUT_MAPPING_EXIT

public static final java.lang.String INPUT_MAPPING_EXIT
See Also:
Constant Field Values

INPUT_MAPPING_CAMERA_POS

public static final java.lang.String INPUT_MAPPING_CAMERA_POS
See Also:
Constant Field Values

INPUT_MAPPING_MEMORY

public static final java.lang.String INPUT_MAPPING_MEMORY
See Also:
Constant Field Values

INPUT_MAPPING_HIDE_STATS

public static final java.lang.String INPUT_MAPPING_HIDE_STATS
See Also:
Constant Field Values

rootNode

protected Node rootNode

guiNode

protected Node guiNode

fpsText

protected BitmapText fpsText

guiFont

protected BitmapFont guiFont

flyCam

protected FlyByCamera flyCam

showSettings

protected boolean showSettings
Constructor Detail

SimpleApplication

public SimpleApplication()

SimpleApplication

public SimpleApplication(AppState... initialStates)
Method Detail

start

public void start()
Description copied from class: Application
Starts the application in display mode.

Overrides:
start in class Application
See Also:
Application.start(com.jme3.system.JmeContext.Type)

getFlyByCamera

public FlyByCamera getFlyByCamera()
Retrieves flyCam

Returns:
flyCam Camera object

getGuiNode

public Node getGuiNode()
Retrieves guiNode

Returns:
guiNode Node object

getRootNode

public Node getRootNode()
Retrieves rootNode

Returns:
rootNode Node object

isShowSettings

public boolean isShowSettings()

setShowSettings

public void setShowSettings(boolean showSettings)
Toggles settings window to display at start-up

Parameters:
showSettings - Sets true/false

loadGuiFont

protected BitmapFont loadGuiFont()
Creates the font that will be set to the guiFont field and subsequently set as the font for the stats text.


initialize

public void initialize()
Description copied from class: Application
Do not call manually. Callback from ContextListener.

Initializes the Application, by creating a display and default camera. If display settings are not specified, a default 640x480 display is created. Default values are used for the camera; perspective projection with 45° field of view, with near and far values 1 and 1000 units respectively.

Specified by:
initialize in interface SystemListener
Overrides:
initialize in class Application

update

public void update()
Description copied from class: Application
Do not call manually. Callback from ContextListener.

Specified by:
update in interface SystemListener
Overrides:
update in class Application

setDisplayFps

public void setDisplayFps(boolean show)

setDisplayStatView

public void setDisplayStatView(boolean show)

simpleInitApp

public abstract void simpleInitApp()

simpleUpdate

public void simpleUpdate(float tpf)

simpleRender

public void simpleRender(RenderManager rm)