Package com.jme3.system
Class AWTFrameProcessor
java.lang.Object
com.jme3.system.AWTFrameProcessor
- All Implemented Interfaces:
SceneProcessor,PropertyChangeListener,EventListener
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ComponentThe destination of jMe frames.protected PropertyChangeListenerThe height listener.protected PropertyChangeListenerThe ration listener.protected PropertyChangeListenerThe width listener. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(Component destination, Application application) Bind this processor.voidbind(Component destination, Application application, ViewPort viewPort) Bind this processor.voidbind(Component destination, Application application, ViewPort viewPort, boolean main) Bind this processor.protected voidbindDestination(Application application, Component destination) Bind this processor.protected voidvoidcleanup()Called when the SP is removed from the RM.protected AWTComponentRenderercreateFrameTransfer(FrameBuffer frameBuffer, int width, int height) Create a new frame transfer.protected ApplicationGets the application.protected intGets camera angle.protected ComponentGets the current destination.protected intGets destination height.protected intGets destination width.protected AWTComponentRendererGets the frame transfer.protected RenderManagerGets the render manager.protected ViewPortGets the view port.protected booleanChecks of existing application.protected booleanChecks of existing destination.voidinitialize(RenderManager rm, ViewPort vp) Called in the render thread to initialize the scene processor.booleanbooleanbooleanisMain()protected booleanIs preserve ratio.protected voidnotifyChangedHeight(Number newValue) Notify about that the height was changed.protected voidnotifyChangedRatio(Boolean newValue) Notify about that the ratio was changed.protected voidnotifyChangedWidth(Number newValue) Notify about that the width was changed.protected voidnotifyComponentResized(int newWidth, int newHeight, boolean fixAspect) Handle resizing.voidpostFrame(FrameBuffer out) Called after a frame has been rendered and the queue flushed.voidpostQueue(RenderQueue rq) Called after the scene graph has been queued, but before it is flushed.voidpreFrame(float tpf) Called before a framevoidvoidreshape()voidCalled when the resolution of the viewport has been changed.protected voidreshapeCurrentViewPort(int width, int height) Reshape the current view port.protected AWTComponentRendererreshapeInThread(int width, int height, boolean fixAspect) Reshape the current frame transfer for the new size.protected voidsetApplication(Application application) Sets the application.protected voidsetDestination(Component destination) Sets the destination.voidsetEnabled(boolean enabled) protected voidsetFrameTransfer(AWTComponentRenderer frameTransfer) Sets the frame transfer.voidsetProfiler(AppProfiler profiler) Sets a profiler Instance for this processor.voidsetTransferMode(AWTFrameProcessor.TransferMode transferMode) voidunbind()Unbind this processor from its current destination.protected voidUnbind this processor from destination.protected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:SceneProcessorCalled in the render thread to initialize the scene processor.- Specified by:
initializein 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:SceneProcessorCalled when the resolution of the viewport has been changed.- Specified by:
reshapein interfaceSceneProcessor- Parameters:
vp- the affected ViewPortw- the new width (in pixels)h- the new height (in pixels)
-
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfaceSceneProcessor- Returns:
- True if initialize() has been called on this SceneProcessor, false if otherwise.
-
preFrame
public void preFrame(float tpf) Description copied from interface:SceneProcessorCalled before a frame- Specified by:
preFramein interfaceSceneProcessor- Parameters:
tpf- Time per frame
-
postQueue
Description copied from interface:SceneProcessorCalled after the scene graph has been queued, but before it is flushed.- Specified by:
postQueuein interfaceSceneProcessor- Parameters:
rq- The render queue
-
postFrame
Description copied from interface:SceneProcessorCalled after a frame has been rendered and the queue flushed.- Specified by:
postFramein interfaceSceneProcessor- Parameters:
out- The FB to which the scene was rendered.
-
cleanup
public void cleanup()Description copied from interface:SceneProcessorCalled when the SP is removed from the RM.- Specified by:
cleanupin interfaceSceneProcessor
-
setProfiler
Description copied from interface:SceneProcessorSets a profiler Instance for this processor.- Specified by:
setProfilerin interfaceSceneProcessor- Parameters:
profiler- the profiler instance.
-
propertyChange
- Specified by:
propertyChangein 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
-