Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.util
Class PerformanceMonitor

java.lang.Object
  extended by org.j3d.renderer.aviatrix3d.util.PerformanceMonitor

public class PerformanceMonitor
extends java.lang.Object

Utility class for watching the performance of the application (measured by frame rate) and then issuing notifications on when to upgrade or downgrade the rendering infrastructure to keep it within the goal bounds.

The system collects a set of listeners that register with the monitor and provide their own priority. A higher priority listener will be called before a lower priority listener for updates to both upgrade and downgrade their performance.

Internationalisation Resource Names

Version:
$Revision: 1.4 $
Author:
Justin Couch

Constructor Summary
PerformanceMonitor()
          Create a new monitor instance.
 
Method Summary
 void addPerformanceListener(SystemPerformanceListener l, int priority)
          Add a system performance listener to the list to be processed.
 void appShutdown()
          Notification that the AV3D internal shutdown handler has detected a system-wide shutdown.
 float getMaximumFrameRate()
          Get the current maximum acceptable frame rate.
 float getMinimumFrameRate()
          Get the current minimum acceptable frame rate.
 int getUpdateInterval()
          Get the current checking interval.
 void removePerformanceListener(SystemPerformanceListener l)
          Remove a system performance listener from the current processing list.
 void setMaximumFrameRate(float fps)
          Get the current maximum acceptable frame rate.
 void setMinimumFrameRate(float fps)
          Get the current minimum acceptable frame rate.
 void setUpdateInterval(int interval)
          Set the update interval.
 void updateMetrics()
          Notification that now is a good time to update the scene graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerformanceMonitor

public PerformanceMonitor()
Create a new monitor instance.

Method Detail

updateMetrics

public void updateMetrics()
Notification that now is a good time to update the scene graph.


appShutdown

public void appShutdown()
Notification that the AV3D internal shutdown handler has detected a system-wide shutdown. The aviatrix code has already terminated rendering at the point this method is called, only the user's system code needs to terminate before exiting here.


getUpdateInterval

public int getUpdateInterval()
Get the current checking interval. Time is in milliseconds.

Returns:
The interval time in milliseconds

setUpdateInterval

public void setUpdateInterval(int interval)
                       throws java.lang.IllegalArgumentException
Set the update interval. The interval must be greater than zero. Time is in milliseconds.

Parameters:
interval - The new interval value to set. Must be > zero
Throws:
java.lang.IllegalArgumentException - The value was not positive

getMinimumFrameRate

public float getMinimumFrameRate()
Get the current minimum acceptable frame rate.

Returns:
A value greater than zero

setMinimumFrameRate

public void setMinimumFrameRate(float fps)
                         throws java.lang.IllegalArgumentException
Get the current minimum acceptable frame rate. A value of zero means don't send the minimum framerate message

Parameters:
fps - The frames per second number
Throws:
java.lang.IllegalArgumentException - The value was negative or greater than or equal to the max FPS

getMaximumFrameRate

public float getMaximumFrameRate()
Get the current maximum acceptable frame rate.

Returns:
A value greater than zero

setMaximumFrameRate

public void setMaximumFrameRate(float fps)
                         throws java.lang.IllegalArgumentException
Get the current maximum acceptable frame rate. A value of zero means don't send the maximum framerate message

Parameters:
fps - The frames per second number
Throws:
java.lang.IllegalArgumentException - The value was negative or less than or equal to the minimum FPS

addPerformanceListener

public void addPerformanceListener(SystemPerformanceListener l,
                                   int priority)
Add a system performance listener to the list to be processed. Duplicate entries are ignored. A higher number for the priority increases its chances of being called before the other listeners for controlling performance.

Parameters:
l - The new listener instance to be handled

removePerformanceListener

public void removePerformanceListener(SystemPerformanceListener l)
Remove a system performance listener from the current processing list. If it is not currently added, it is silently ignored.

Parameters:
l - The listener instance to be removed

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org