Package com.jme3.system
Class AWTFrameProcessor
java.lang.Object
com.jme3.system.AWTFrameProcessor
- All Implemented Interfaces:
SceneProcessor
,PropertyChangeListener
,EventListener
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected Component
The destination of jMe frames.protected PropertyChangeListener
The height listener.protected PropertyChangeListener
The ration listener.protected PropertyChangeListener
The width listener. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(Component destination, Application application) Bind this processor.void
bind
(Component destination, Application application, ViewPort viewPort) Bind this processor.void
bind
(Component destination, Application application, ViewPort viewPort, boolean main) Bind this processor.protected void
bindDestination
(Application application, Component destination) Bind this processor.protected void
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
Gets the application.protected int
Gets camera angle.protected Component
Gets the current destination.protected int
Gets destination height.protected int
Gets destination width.protected AWTComponentRenderer
Gets the frame transfer.protected RenderManager
Gets the render manager.protected ViewPort
Gets the view port.protected boolean
Checks of existing application.protected boolean
Checks of existing destination.void
initialize
(RenderManager rm, ViewPort vp) Called in the render thread to initialize the scene processor.boolean
boolean
boolean
isMain()
protected boolean
Is preserve ratio.protected void
notifyChangedHeight
(Number newValue) Notify about that the height was changed.protected void
notifyChangedRatio
(Boolean newValue) Notify about that the ratio was changed.protected void
notifyChangedWidth
(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 framevoid
void
reshape()
void
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
(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
Unbind this processor from destination.protected void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jme3.post.SceneProcessor
rescale
-
Field Details
-
widthListener
The width listener. -
heightListener
The height listener. -
rationListener
The ration listener. -
destination
The destination of jMe frames.
-
-
Constructor Details
-
AWTFrameProcessor
public AWTFrameProcessor()
-
-
Method Details
-
initialize
Description copied from interface:SceneProcessor
Called in the render thread to initialize the scene processor.- Specified by:
initialize
in interfaceSceneProcessor
- Parameters:
rm
- The render manager to which the SP was added tovp
- The viewport to which the SP is assigned
-
reshape
Description copied from interface:SceneProcessor
Called when the resolution of the viewport has been changed.- Specified by:
reshape
in interfaceSceneProcessor
- Parameters:
vp
- the affected ViewPortw
- the new width (in pixels)h
- the new height (in pixels)
-
isInitialized
public boolean isInitialized()- Specified by:
isInitialized
in interfaceSceneProcessor
- Returns:
- True if initialize() has been called on this SceneProcessor, false if otherwise.
-
preFrame
public void preFrame(float tpf) Description copied from interface:SceneProcessor
Called before a frame- Specified by:
preFrame
in interfaceSceneProcessor
- Parameters:
tpf
- Time per frame
-
postQueue
Description copied from interface:SceneProcessor
Called after the scene graph has been queued, but before it is flushed.- Specified by:
postQueue
in interfaceSceneProcessor
- Parameters:
rq
- The render queue
-
postFrame
Description copied from interface:SceneProcessor
Called after a frame has been rendered and the queue flushed.- Specified by:
postFrame
in interfaceSceneProcessor
- Parameters:
out
- The FB to which the scene was rendered.
-
cleanup
public void cleanup()Description copied from interface:SceneProcessor
Called when the SP is removed from the RM.- Specified by:
cleanup
in interfaceSceneProcessor
-
setProfiler
Description copied from interface:SceneProcessor
Sets a profiler Instance for this processor.- Specified by:
setProfiler
in interfaceSceneProcessor
- Parameters:
profiler
- the profiler instance.
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
notifyChangedRatio
Notify about that the ratio was changed.- Parameters:
newValue
- the new value of the ratio.
-
notifyChangedHeight
Notify about that the height was changed.- Parameters:
newValue
- the new value of the height.
-
notifyChangedWidth
Notify about that the width was changed.- Parameters:
newValue
- the new value of the width.
-
getApplication
Gets the application.- Returns:
- the application.
-
setApplication
Sets the application.- Parameters:
application
- the application.
-
getDestination
Gets the current destination.- Returns:
- the current destination.
-
setDestination
Sets the destination.- Parameters:
destination
- the destination.
-
hasDestination
protected boolean hasDestination()Checks of existing destination.- Returns:
- true if destination is exists.
-
hasApplication
protected boolean hasApplication()Checks of existing application.- Returns:
- true if destination is exists.
-
getFrameTransfer
Gets the frame transfer.- Returns:
- the file transfer.
-
setFrameTransfer
Sets the frame transfer.- Parameters:
frameTransfer
- the file transfer.
-
getViewPort
Gets the view port.- Returns:
- the view port.
-
getRenderManager
Gets the render manager.- Returns:
- the render manager.
-
isMain
public boolean isMain() -
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
notifyComponentResized
protected void notifyComponentResized(int newWidth, int newHeight, boolean fixAspect) Handle resizing.- Parameters:
newWidth
- the new width.newHeight
- the new height.fixAspect
- true to fix the aspect ratio.
-
reshape
public void reshape() -
isPreserveRatio
protected boolean isPreserveRatio()Is preserve ratio.- Returns:
- is preserve ratio.
-
getDestinationWidth
protected int getDestinationWidth()Gets destination width.- Returns:
- the destination width.
-
getDestinationHeight
protected int getDestinationHeight()Gets destination height.- Returns:
- the destination height.
-
bind
Bind this processor.- Parameters:
destination
- the destination.application
- the application.
-
bind
Bind this processor.- Parameters:
destination
- the destination.application
- the application.viewPort
- the view port.
-
bind
Bind this processor.- Parameters:
destination
- the destination.application
- the application.viewPort
- the view port.main
- true if this processor is main.
-
unbind
public void unbind()Unbind this processor from its current destination. -
bindDestination
Bind this processor.- Parameters:
application
- the application.destination
- the destination.
-
unbindDestination
protected void unbindDestination()Unbind this processor from destination. -
bindListeners
protected void bindListeners() -
unbindListeners
protected void unbindListeners() -
reshapeInThread
Reshape the current frame transfer for the new size.- Parameters:
width
- the width.height
- the height.fixAspect
- true to fix the aspect ratio.- Returns:
- the new frame transfer.
-
createFrameTransfer
Create a new frame transfer.- Parameters:
frameBuffer
- the frame buffer.width
- the width.height
- the height.- Returns:
- the new frame transfer.
-
reshapeCurrentViewPort
protected void reshapeCurrentViewPort(int width, int height) Reshape the current view port.- Parameters:
width
- the width.height
- the height.
-
getCameraAngle
protected int getCameraAngle()Gets camera angle.- Returns:
- the camera angle.
-
getTransferMode
-
setTransferMode
-