public class AWTFrameProcessor
extends java.lang.Object
implements com.jme3.post.SceneProcessor, java.beans.PropertyChangeListener
This class is based on the JavaFX original code provided by Alexander Brui (see JME3-FX)
| Modifier and Type | Class and Description |
|---|---|
static class |
AWTFrameProcessor.TransferMode |
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Component |
destination
The destination of jMe frames.
|
protected java.beans.PropertyChangeListener |
heightListener
The height listener.
|
protected java.beans.PropertyChangeListener |
rationListener
The ration listener.
|
protected java.beans.PropertyChangeListener |
widthListener
The width listener.
|
| Constructor and Description |
|---|
AWTFrameProcessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(java.awt.Component destination,
com.jme3.app.Application application)
Bind this processor.
|
void |
bind(java.awt.Component destination,
com.jme3.app.Application application,
com.jme3.renderer.ViewPort viewPort)
Bind this processor.
|
void |
bind(java.awt.Component destination,
com.jme3.app.Application application,
com.jme3.renderer.ViewPort viewPort,
boolean main)
Bind this processor.
|
protected void |
bindDestination(com.jme3.app.Application application,
java.awt.Component destination)
Bind this processor.
|
protected void |
bindListeners() |
void |
cleanup() |
protected AWTComponentRenderer |
createFrameTransfer(com.jme3.texture.FrameBuffer frameBuffer,
int width,
int height)
Create a new frame transfer.
|
protected com.jme3.app.Application |
getApplication()
Gets the application.
|
protected int |
getCameraAngle()
Gets camera angle.
|
protected java.awt.Component |
getDestination()
Gets the current destination.
|
protected int |
getDestinationHeight()
Gets destination height.
|
protected int |
getDestinationWidth()
Gets destination width.
|
protected AWTComponentRenderer |
getFrameTransfer()
Gets the frame transfer.
|
protected com.jme3.renderer.RenderManager |
getRenderManager()
Gets the render manager.
|
AWTFrameProcessor.TransferMode |
getTransferMode() |
protected com.jme3.renderer.ViewPort |
getViewPort()
Gets the view port.
|
protected boolean |
hasApplication()
Checks of existing application.
|
protected boolean |
hasDestination()
Checks of existing destination.
|
void |
initialize(com.jme3.renderer.RenderManager rm,
com.jme3.renderer.ViewPort vp) |
boolean |
isEnabled() |
boolean |
isInitialized() |
boolean |
isMain() |
protected boolean |
isPreserveRatio()
Is preserve ratio.
|
protected void |
notifyChangedHeight(java.lang.Number newValue)
Notify about that the height was changed.
|
protected void |
notifyChangedRatio(java.lang.Boolean newValue)
Notify about that the ratio was changed.
|
protected void |
notifyChangedWidth(java.lang.Number newValue)
Notify about that the width was changed.
|
protected void |
notifyComponentResized(int newWidth,
int newHeight,
boolean fixAspect)
Handle resizing.
|
void |
postFrame(com.jme3.texture.FrameBuffer out) |
void |
postQueue(com.jme3.renderer.queue.RenderQueue rq) |
void |
preFrame(float tpf) |
void |
propertyChange(java.beans.PropertyChangeEvent evt) |
void |
reshape() |
void |
reshape(com.jme3.renderer.ViewPort vp,
int w,
int h) |
protected void |
reshapeCurrentViewPort(int width,
int height)
Reshape the current view port.
|
protected AWTComponentRenderer |
reshapeInThread(int width,
int height,
boolean fixAspect)
Reshape the current frame transfer for the new size.
|
protected void |
setApplication(com.jme3.app.Application application)
Sets the application.
|
protected void |
setDestination(java.awt.Component destination)
Sets the destination.
|
void |
setEnabled(boolean enabled) |
protected void |
setFrameTransfer(AWTComponentRenderer frameTransfer)
Sets the frame transfer.
|
void |
setProfiler(com.jme3.profile.AppProfiler profiler) |
void |
setTransferMode(AWTFrameProcessor.TransferMode transferMode) |
void |
unbind()
Unbind this processor from its current destination.
|
protected void |
unbindDestination()
Unbind this processor from destination.
|
protected void |
unbindListeners() |
protected java.beans.PropertyChangeListener widthListener
protected java.beans.PropertyChangeListener heightListener
protected java.beans.PropertyChangeListener rationListener
protected volatile java.awt.Component destination
public void initialize(com.jme3.renderer.RenderManager rm,
com.jme3.renderer.ViewPort vp)
initialize in interface com.jme3.post.SceneProcessorpublic void reshape(com.jme3.renderer.ViewPort vp,
int w,
int h)
reshape in interface com.jme3.post.SceneProcessorpublic boolean isInitialized()
isInitialized in interface com.jme3.post.SceneProcessorpublic void preFrame(float tpf)
preFrame in interface com.jme3.post.SceneProcessorpublic void postQueue(com.jme3.renderer.queue.RenderQueue rq)
postQueue in interface com.jme3.post.SceneProcessorpublic void postFrame(com.jme3.texture.FrameBuffer out)
postFrame in interface com.jme3.post.SceneProcessorpublic void cleanup()
cleanup in interface com.jme3.post.SceneProcessorpublic void setProfiler(com.jme3.profile.AppProfiler profiler)
setProfiler in interface com.jme3.post.SceneProcessorpublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerprotected void notifyChangedRatio(java.lang.Boolean newValue)
newValue - the new value of the ratio.protected void notifyChangedHeight(java.lang.Number newValue)
newValue - the new value of the height.protected void notifyChangedWidth(java.lang.Number newValue)
newValue - the new value of the width.protected com.jme3.app.Application getApplication()
protected void setApplication(com.jme3.app.Application application)
application - the application.protected java.awt.Component getDestination()
protected void setDestination(java.awt.Component destination)
destination - the destination.protected boolean hasDestination()
protected boolean hasApplication()
protected AWTComponentRenderer getFrameTransfer()
protected void setFrameTransfer(AWTComponentRenderer frameTransfer)
frameTransfer - the file transfer.protected com.jme3.renderer.ViewPort getViewPort()
protected com.jme3.renderer.RenderManager getRenderManager()
public boolean isMain()
public boolean isEnabled()
public void setEnabled(boolean enabled)
protected void notifyComponentResized(int newWidth,
int newHeight,
boolean fixAspect)
newWidth - the new width.newHeight - the new height.fixAspect - true to fix the aspect ratio.public void reshape()
protected boolean isPreserveRatio()
protected int getDestinationWidth()
protected int getDestinationHeight()
public void bind(java.awt.Component destination,
com.jme3.app.Application application)
destination - the destination.application - the application.public void bind(java.awt.Component destination,
com.jme3.app.Application application,
com.jme3.renderer.ViewPort viewPort)
destination - the destination.application - the application.viewPort - the view port.public void bind(java.awt.Component destination,
com.jme3.app.Application application,
com.jme3.renderer.ViewPort viewPort,
boolean main)
destination - the destination.application - the application.viewPort - the view port.main - true if this processor is main.public void unbind()
protected void bindDestination(com.jme3.app.Application application,
java.awt.Component destination)
application - the application.destination - the destination.protected void unbindDestination()
protected void bindListeners()
protected void unbindListeners()
protected AWTComponentRenderer reshapeInThread(int width, int height, boolean fixAspect)
width - the width.height - the height.fixAspect - true to fix the aspect ratio.protected AWTComponentRenderer createFrameTransfer(com.jme3.texture.FrameBuffer frameBuffer, int width, int height)
frameBuffer - the frame buffer.width - the width.height - the height.protected void reshapeCurrentViewPort(int width,
int height)
width - the width.height - the height.protected int getCameraAngle()
public AWTFrameProcessor.TransferMode getTransferMode()
public void setTransferMode(AWTFrameProcessor.TransferMode transferMode)