public class MasterApplication
extends com.jme3.app.SimpleApplication
SimpleApplication
that provides a rendering
functionality for jME-based scenes. Typical (and suggested) workflow for
using a MasterApplication is as follows:
createApplication()
.ViewAppState
).ViewAppState.start(MasterApplication)
).EmbeddedView
via getEmbeddedView()
. This view can
be used to display the AppState's scene. (see
ViewAppState.createComposite(org.eclipse.swt.widgets.Composite)
)releaseEmbeddedView(EmbeddedView)
. (for a
ViewAppState, this happens when you dispose its Composite)ViewAppState.stop()
).
stop()
.AwtPanel
s and the
AwtPanelsContext
. AwtPanels (and any associated objects contained in
the EmbeddedView class) are reused when possible.Constructor and Description |
---|
MasterApplication()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
blockUntilInitialized(int limit)
Blocks the calling thread until the
MasterApplication has
been initialized. |
static MasterApplication |
createApplication()
Creates a default MasterApplication that runs in the background.
|
EmbeddedView |
getEmbeddedView()
Gets an
EmbeddedView that uses this Application for rendering a
jME-based scene. |
com.jme3.font.BitmapFont |
getGuiFont() |
int |
getNextId()
Gets the next available unique integer associated with views or
ViewAppState s. |
boolean |
isInitialized() |
void |
releaseEmbeddedView(EmbeddedView embeddedView)
Releases an
EmbeddedView for use elsewhere in the program. |
void |
simpleInitApp() |
void |
stop()
Disposes all resources directly managed by the
MasterApplication . |
getFlyByCamera, getGuiNode, getRootNode, initialize, isShowSettings, setDisplayFps, setDisplayStatView, setShowSettings, simpleRender, simpleUpdate, start, update
createCanvas, destroy, enqueue, gainFocus, getAssetManager, getAudioRenderer, getCamera, getContext, getGuiViewPort, getInputManager, getListener, getRenderer, getRenderManager, getStateManager, getTimer, getViewPort, handleError, isPauseOnLostFocus, loseFocus, requestClose, reshape, restart, setAssetManager, setPauseOnLostFocus, setSettings, setTimer, start, startCanvas, startCanvas, stop
public MasterApplication()
createApplication()
instead. Only use this if you know what you are doing.public static MasterApplication createApplication()
stop()
method must be called.public void stop()
MasterApplication
.stop
in class com.jme3.app.Application
public int getNextId()
ViewAppState
s. This is used to keep two top-level
Node
s attached to the root Node
from having the
same name.MasterApplication
.public EmbeddedView getEmbeddedView()
EmbeddedView
that uses this Application for rendering a
jME-based scene. This view cannot be used with more than one SWT
Composite with an embedded AWT Frame. When the view is no longer needed,
the client AppState should call
releaseEmbeddedView(EmbeddedView)
with the EmbeddedView returned
by this method.public void releaseEmbeddedView(EmbeddedView embeddedView)
EmbeddedView
for use elsewhere in the program. This
is important because AwtPanel
s cannot yet be easily disposed in
jME.embeddedView
- The EmbeddedView that can be recycled for use elsewhere.public void simpleInitApp()
simpleInitApp
in class com.jme3.app.SimpleApplication
public boolean isInitialized()
MasterApplication
has been
initialized yet. Adding any ViewAppState
s should
wait until this has been initialized.blockUntilInitialized(int)
public boolean blockUntilInitialized(int limit)
MasterApplication
has
been initialized. This method will return either when the app is
initialized or until the limit is reached. By specifying 0 or a negative
number, you can wait indefinitely.limit
- The limit, in seconds, to wait until the
MasterApplication
has initialized.MasterApplication
was initialized, false
otherwise.public com.jme3.font.BitmapFont getGuiFont()
SimpleApplication
's GUI font.