public class AWTFrameProcessor extends java.lang.Object implements SceneProcessor, java.beans.PropertyChangeListener
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,
Application application)
Bind this processor.
|
void |
bind(java.awt.Component destination,
Application application,
ViewPort viewPort)
Bind this processor.
|
void |
bind(java.awt.Component destination,
Application application,
ViewPort viewPort,
boolean main)
Bind this processor.
|
protected void |
bindDestination(Application application,
java.awt.Component destination)
Bind this processor.
|
protected void |
bindListeners() |
void |
cleanup()
Called when the SP is removed from the RM.
|
protected AWTComponentRenderer |
createFrameTransfer(FrameBuffer frameBuffer,
int width,
int height)
Create a new frame transfer.
|
protected 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 RenderManager |
getRenderManager()
Gets the render manager.
|
AWTFrameProcessor.TransferMode |
getTransferMode() |
protected ViewPort |
getViewPort()
Gets the view port.
|
protected boolean |
hasApplication()
Checks of existing application.
|
protected boolean |
hasDestination()
Checks of existing destination.
|
void |
initialize(RenderManager rm,
ViewPort vp)
Called in the render thread to initialize the scene processor.
|
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(FrameBuffer out)
Called after a frame has been rendered and the queue flushed.
|
void |
postQueue(RenderQueue rq)
Called after the scene graph has been queued, but before it is flushed.
|
void |
preFrame(float tpf)
Called before a frame
|
void |
propertyChange(java.beans.PropertyChangeEvent evt) |
void |
reshape() |
void |
reshape(ViewPort vp,
int w,
int h)
Called when the resolution of the viewport has been changed.
|
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(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(AppProfiler profiler)
Sets a profiler Instance for this processor.
|
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
rescale
protected java.beans.PropertyChangeListener widthListener
protected java.beans.PropertyChangeListener heightListener
protected java.beans.PropertyChangeListener rationListener
protected volatile java.awt.Component destination
public void initialize(RenderManager rm, ViewPort vp)
SceneProcessor
initialize
in interface SceneProcessor
rm
- The render manager to which the SP was added tovp
- The viewport to which the SP is assignedpublic void reshape(ViewPort vp, int w, int h)
SceneProcessor
reshape
in interface SceneProcessor
vp
- the affected ViewPortw
- the new width (in pixels)h
- the new height (in pixels)public boolean isInitialized()
isInitialized
in interface SceneProcessor
public void preFrame(float tpf)
SceneProcessor
preFrame
in interface SceneProcessor
tpf
- Time per framepublic void postQueue(RenderQueue rq)
SceneProcessor
postQueue
in interface SceneProcessor
rq
- The render queuepublic void postFrame(FrameBuffer out)
SceneProcessor
postFrame
in interface SceneProcessor
out
- The FB to which the scene was rendered.public void cleanup()
SceneProcessor
cleanup
in interface SceneProcessor
public void setProfiler(AppProfiler profiler)
SceneProcessor
setProfiler
in interface SceneProcessor
profiler
- the profiler instance.public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
protected 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 Application getApplication()
protected void setApplication(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 ViewPort getViewPort()
protected 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, Application application)
destination
- the destination.application
- the application.public void bind(java.awt.Component destination, Application application, ViewPort viewPort)
destination
- the destination.application
- the application.viewPort
- the view port.public void bind(java.awt.Component destination, Application application, 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(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(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)