org.xith3d.loop
Class TitleFPSListener

java.lang.Object
  extended by org.xith3d.loop.TitleFPSListener
All Implemented Interfaces:
ConsciousFPSListener, FPSListener
Direct Known Subclasses:
CanvasFPSListener, FrameFPSListener

public abstract class TitleFPSListener
extends java.lang.Object
implements ConsciousFPSListener

This FPSListener prints the cought FPS to the title of some titled object.


Constructor Summary
TitleFPSListener(java.lang.String baseTitle)
           
 
Method Summary
 java.lang.String getBaseTitle()
           
protected  java.lang.String getDynamicTitlePart(float fps, boolean limited)
           
protected  java.lang.String getLimitedString()
           
 RenderLoop getRenderLoop()
           
protected  boolean isLimited()
           
protected abstract  void onDetachedFromRenderLoop()
          This is called when the listener has been detaced from teh RenderLoop.
 void onFPSCountIntervalHit(float fps)
          This method is called by the RenderLoop each FPS-counting interval
 void setBaseTitle(java.lang.String baseTitle)
          Sets the base-title to prefix the Canvas3D's title with.
 void setRenderLoop(RenderLoop renderLoop)
          Tells the ConsciousFPSListener, which RenderLoop it is linked with.
protected abstract  void setTitle(java.lang.String title)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TitleFPSListener

public TitleFPSListener(java.lang.String baseTitle)
Method Detail

setBaseTitle

public final void setBaseTitle(java.lang.String baseTitle)
Sets the base-title to prefix the Canvas3D's title with.

Parameters:
baseTitle -

getBaseTitle

public final java.lang.String getBaseTitle()
Returns:
the base-title to prefix the Canvas3D's title with.

onDetachedFromRenderLoop

protected abstract void onDetachedFromRenderLoop()
This is called when the listener has been detaced from teh RenderLoop.


setRenderLoop

public final void setRenderLoop(RenderLoop renderLoop)
Tells the ConsciousFPSListener, which RenderLoop it is linked with.

Specified by:
setRenderLoop in interface ConsciousFPSListener

getRenderLoop

public final RenderLoop getRenderLoop()
Returns:
the RenderLoop, this ConsciousFPSListener is linked with.

isLimited

protected boolean isLimited()

getLimitedString

protected java.lang.String getLimitedString()

getDynamicTitlePart

protected java.lang.String getDynamicTitlePart(float fps,
                                               boolean limited)

setTitle

protected abstract void setTitle(java.lang.String title)

onFPSCountIntervalHit

public void onFPSCountIntervalHit(float fps)
This method is called by the RenderLoop each FPS-counting interval

Specified by:
onFPSCountIntervalHit in interface FPSListener
Parameters:
fps - the average frames per second during the last interval