All Packages  This Package  Class Hierarchy  Class Search  Index

Class com.hermetica.util3d.FrameRateComponent
java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----com.hermetica.util3d.FrameRateComponent

  Summary

public class  FrameRateComponent
     extends java.awt.Canvas
{
          // Constructors 2
     public FrameRateComponent();
     public FrameRateComponent(float, float, int, PrintStream);

          // Methods 6
     public void outputFrameRate(float, long);
     public void outputFrameRateAverage(float, float);
     public void setOutputStream(PrintStream);
     public void setSummaryOnly(boolean);
     public void startSample();
     public void stopSample();
}

AWT Component that can be added to any application to report the time taken between a start and stop operation. For example, it can be used quite successfully to calculate frame rates for 3d rendering applications.

Version:
$Id: FrameRateComponent.java,v 1.4 1998/02/23 21:27:28 descarte Exp descarte $
Author:
Alligator Descartes <descarte@hermetica.com>




  Constructors

· FrameRateComponent

Summary  |  Top

   public FrameRateComponent() 

Creates a new FrameRateComponent object with the default settings of a high watermark of 10fps, low watermark of 0, sample array of size 16 and output component being GUI



· FrameRateComponent

Summary  |  Top
   public FrameRateComponent(float highWatermark, 
                             float lowWatermark, 
                             int sampleSize, 
                             PrintStream stream) 

Creates a new FrameRateComponent object with non-default settings



  Methods

· startSample

Summary  |  Top
   public void startSample() 

Start sampling by taking the current time in milliseconds



· stopSample

Summary  |  Top
   public void stopSample() 

Complete sample and calculate current frame rate



· setSummaryOnly

Summary  |  Top
   public void setSummaryOnly(boolean summaryOnly) 

Specifies whether we should print each frame rate or just the summary



· outputFrameRate

Summary  |  Top
   public void outputFrameRate(float frameRate, 
                               long updateTime) 

Writes the frame rate for this frame onto the output device



· outputFrameRateAverage

Summary  |  Top
   public void outputFrameRateAverage(float average, 
                                      float updateAverage) 

Writes the average frame rate out onto the output device



· setOutputStream

Summary  |  Top
   public void setOutputStream(PrintStream stream) 

Toggles between output going to the graphical display or a standard PrintStream. If a null value is supplied for the PrintStream argument, we take that as using the graphical display.



All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7