Package org.xj3d.impl.core.loading
Class FramerateThrottle
java.lang.Object
java.lang.Thread
org.xj3d.impl.core.loading.FramerateThrottle
- All Implemented Interfaces:
Runnable,org.ietf.uri.event.ProgressListener,BrowserCoreListener
public class FramerateThrottle
extends Thread
implements org.ietf.uri.event.ProgressListener, BrowserCoreListener
Determines what the frame rate should be based on available information.
- Version:
- $Revision: 1.7 $
- Author:
- Alan Hudson
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionFramerateThrottle(BrowserCore core, org.j3d.util.ErrorReporter reporter) Construct a new instance of the throttle for the given core instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidThe browser has been disposed, all resources may be freed.voidbrowserInitialized(VRMLScene scene) The browser has been initialised with new content.voidThe browser has been shut down and the previous content is no longer valid.voidconnectionEstablished(org.ietf.uri.event.ProgressEvent evt) A connection to the resource has been established.voiddownloadEnded(org.ietf.uri.event.ProgressEvent evt) The download has ended.voiddownloadError(org.ietf.uri.event.ProgressEvent evt) An error has occurred during the download.voiddownloadStarted(org.ietf.uri.event.ProgressEvent evt) The download has started.voiddownloadUpdate(org.ietf.uri.event.ProgressEvent evt) The download has updated its status.voidhandshakeInProgress(org.ietf.uri.event.ProgressEvent evt) The header information reading and handshaking is taking place.booleanHas the initial load finished.voidrun()Run the contents of this thread now.voidsetLoadManager(ContentLoadManager manager) Set the content load manager to query.voidsetMinimumNoLoading(int val) Set the minimum frame cycle time when nothing is loading.voidsetScriptLoader(ScriptLoader loader) Set the script loader to query.voidshutdown()Stop the execution of this thread.voidNotify the throttle that a file load has started.voidurlLoadFailed(String msg) The tried to load a URL and failed.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Constructor Details
-
FramerateThrottle
Construct a new instance of the throttle for the given core instance.- Parameters:
core- The core instance to work withreporter-
-
-
Method Details
-
browserInitialized
The browser has been initialised with new content. The content given is found in the accompanying scene and description.- Specified by:
browserInitializedin interfaceBrowserCoreListener- Parameters:
scene- The scene of the new content
-
urlLoadFailed
The tried to load a URL and failed. It is typically because none of the URLs resolved to anything valid or there were network failures.- Specified by:
urlLoadFailedin interfaceBrowserCoreListener- Parameters:
msg- An error message to go with the failure
-
browserShutdown
public void browserShutdown()The browser has been shut down and the previous content is no longer valid.- Specified by:
browserShutdownin interfaceBrowserCoreListener
-
browserDisposed
public void browserDisposed()The browser has been disposed, all resources may be freed.- Specified by:
browserDisposedin interfaceBrowserCoreListener
-
connectionEstablished
public void connectionEstablished(org.ietf.uri.event.ProgressEvent evt) A connection to the resource has been established. At this point, no data has yet been downloaded.- Specified by:
connectionEstablishedin interfaceorg.ietf.uri.event.ProgressListener- Parameters:
evt- The event that caused this method to be called.
-
handshakeInProgress
public void handshakeInProgress(org.ietf.uri.event.ProgressEvent evt) The header information reading and handshaking is taking place. Reading and interpreting of the data (a download started event) should commence shortly. When that begins, you will be given the appropriate event.- Specified by:
handshakeInProgressin interfaceorg.ietf.uri.event.ProgressListener- Parameters:
evt- The event that caused this method to be called.
-
downloadStarted
public void downloadStarted(org.ietf.uri.event.ProgressEvent evt) The download has started.- Specified by:
downloadStartedin interfaceorg.ietf.uri.event.ProgressListener- Parameters:
evt- The event that caused this method to be called.
-
downloadUpdate
public void downloadUpdate(org.ietf.uri.event.ProgressEvent evt) The download has updated its status.- Specified by:
downloadUpdatein interfaceorg.ietf.uri.event.ProgressListener- Parameters:
evt- The event that caused this method to be called.
-
downloadEnded
public void downloadEnded(org.ietf.uri.event.ProgressEvent evt) The download has ended.- Specified by:
downloadEndedin interfaceorg.ietf.uri.event.ProgressListener- Parameters:
evt- The event that caused this method to be called.
-
downloadError
public void downloadError(org.ietf.uri.event.ProgressEvent evt) An error has occurred during the download.- Specified by:
downloadErrorin interfaceorg.ietf.uri.event.ProgressListener- Parameters:
evt- The event that caused this method to be called.
-
run
-
isInitialLoadDone
public boolean isInitialLoadDone()Has the initial load finished. Somewhat subjective, but basically have the items referenced in the main file finished loading.- Returns:
- Is the initial loading finished.
-
setMinimumNoLoading
public void setMinimumNoLoading(int val) Set the minimum frame cycle time when nothing is loading.- Parameters:
val- The minimum cycle time
-
startedLoading
public void startedLoading()Notify the throttle that a file load has started. Won't be necessary once the main loading use a content handler. -
setScriptLoader
Set the script loader to query. Null is ok.- Parameters:
loader- The script loader
-
setLoadManager
Set the content load manager to query. Null is ok.- Parameters:
manager- The content load manager
-
shutdown
public void shutdown()Stop the execution of this thread.
-