public class AWTContext extends java.lang.Object implements JmeContext
JmeContext.Type
Modifier and Type | Field and Description |
---|---|
protected JmeContext |
backgroundContext
The background context.
|
protected AWTKeyInput |
keyInput
The key input.
|
protected AWTMouseInput |
mouseInput
The mouse input.
|
protected AppSettings |
settings
The settings.
|
Constructor and Description |
---|
AWTContext() |
Modifier and Type | Method and Description |
---|---|
void |
create(boolean waitFor)
Creates the context and makes it active.
|
protected JmeContext |
createBackgroundContext() |
protected AppSettings |
createSettings() |
void |
destroy(boolean waitFor)
Destroys the context completely, making it inactive.
|
int |
getFramebufferHeight()
Returns the height of the framebuffer.
|
int |
getFramebufferWidth()
Returns the width of the framebuffer.
|
int |
getHeight() |
JoyInput |
getJoyInput() |
AWTKeyInput |
getKeyInput() |
AWTMouseInput |
getMouseInput() |
Context |
getOpenCLContext() |
Renderer |
getRenderer() |
AppSettings |
getSettings() |
SystemListener |
getSystemListener()
Accesses the listener that receives events related to this context.
|
Timer |
getTimer() |
TouchInput |
getTouchInput() |
JmeContext.Type |
getType() |
int |
getWidth() |
int |
getWindowXPosition()
Returns the screen X coordinate of the left edge of the content area.
|
int |
getWindowYPosition()
Returns the screen Y coordinate of the top edge of the content area.
|
boolean |
isCreated() |
boolean |
isRenderable() |
void |
restart()
Destroys and then re-creates the context.
|
void |
setAutoFlushFrames(boolean enabled) |
void |
setHeight(int height) |
void |
setSettings(AppSettings settings) |
void |
setSystemListener(SystemListener listener)
Sets the listener that will receive events relating to context
creation, update, and destroy.
|
void |
setTitle(java.lang.String title)
Sets the title of the display (if available).
|
void |
setWidth(int width) |
protected final AppSettings settings
protected final AWTKeyInput keyInput
protected final AWTMouseInput mouseInput
protected JmeContext backgroundContext
public int getHeight()
public void setHeight(int height)
height
- the current height.public int getWidth()
public void setWidth(int width)
width
- the current width.protected AppSettings createSettings()
protected JmeContext createBackgroundContext()
public JmeContext.Type getType()
getType
in interface JmeContext
public void setSettings(AppSettings settings)
setSettings
in interface JmeContext
settings
- the display settings to use for the created context. If
the context has already been created, then restart()
must be called
for the changes to be applied.public SystemListener getSystemListener()
getSystemListener
in interface JmeContext
public void setSystemListener(SystemListener listener)
JmeContext
setSystemListener
in interface JmeContext
listener
- the desired listenerpublic AppSettings getSettings()
getSettings
in interface JmeContext
public Renderer getRenderer()
getRenderer
in interface JmeContext
public Context getOpenCLContext()
getOpenCLContext
in interface JmeContext
public AWTMouseInput getMouseInput()
getMouseInput
in interface JmeContext
public AWTKeyInput getKeyInput()
getKeyInput
in interface JmeContext
public JoyInput getJoyInput()
getJoyInput
in interface JmeContext
public TouchInput getTouchInput()
getTouchInput
in interface JmeContext
public Timer getTimer()
getTimer
in interface JmeContext
public void setTitle(java.lang.String title)
JmeContext
setTitle
in interface JmeContext
title
- The new title of the display.public boolean isCreated()
isCreated
in interface JmeContext
public boolean isRenderable()
isRenderable
in interface JmeContext
Renderer
are called
while this is false
, then the result is undefined.public void setAutoFlushFrames(boolean enabled)
setAutoFlushFrames
in interface JmeContext
enabled
- If enabled, the context will automatically flush
frames to the video card (swap buffers) after an update cycle.public void create(boolean waitFor)
JmeContext
create
in interface JmeContext
waitFor
- If true, will wait until context has initialized.public void restart()
JmeContext
restart
in interface JmeContext
public void destroy(boolean waitFor)
JmeContext
destroy
in interface JmeContext
waitFor
- If true, will wait until the context is destroyed fully.public int getFramebufferHeight()
getFramebufferHeight
in interface JmeContext
public int getFramebufferWidth()
getFramebufferWidth
in interface JmeContext
public int getWindowXPosition()
getWindowXPosition
in interface JmeContext
java.lang.UnsupportedOperationException
public int getWindowYPosition()
getWindowYPosition
in interface JmeContext
java.lang.UnsupportedOperationException