org.ogre4j
Class ResourceBackgroundQueue

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.ResourceBackgroundQueue
All Implemented Interfaces:
IAllocatedObject<IResourceAllocPolicy>, IResourceAllocatedObject, IResourceBackgroundQueue, ISingleton<IResourceBackgroundQueue>, INativeObject

public class ResourceBackgroundQueue
extends NativeObject
implements IResourceBackgroundQueue


Nested Class Summary
static class ResourceBackgroundQueue.Listener
           
protected static class ResourceBackgroundQueue.NotificationQueue
           
protected static class ResourceBackgroundQueue.QueuedNotification
           
protected static class ResourceBackgroundQueue.Request
           
protected static class ResourceBackgroundQueue.RequestQueue
           
protected static class ResourceBackgroundQueue.RequestTicketMap
           
protected static class ResourceBackgroundQueue.RequestType
           
 
Nested classes/interfaces inherited from interface org.ogre4j.IResourceBackgroundQueue
IResourceBackgroundQueue.IListener, IResourceBackgroundQueue.INotificationQueue, IResourceBackgroundQueue.IQueuedNotification, IResourceBackgroundQueue.IRequest, IResourceBackgroundQueue.IRequestQueue, IResourceBackgroundQueue.IRequestTicketMap
 
Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  ResourceBackgroundQueue()
           
  ResourceBackgroundQueue(InstancePointer p)
          This constructor is public for internal useage only!
protected ResourceBackgroundQueue(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  ResourceBackgroundQueue(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 boolean _doNextQueuedBackgroundProcess()
          Process a single queued background operation.
 void _fireOnFrameCallbacks()
          Fires all the queued events for background loaded resources.
 void _initThread()
          Initialise processing for a background thread.
 void _queueFireBackgroundLoadingComplete(IResource res)
          Queue the firing of the 'background loading complete' event to a event.
 void _queueFireBackgroundPreparingComplete(IResource res)
          Queue the firing of the 'background preparing complete' event to a event.
 void delete()
          Deletes the corresponding C++ object.
 void finalize()
           
static IResourceBackgroundQueue getSingleton()
          Override standard retrieval.
static IResourceBackgroundQueue getSingletonPtr()
          Override standard retrieval.
 boolean getStartBackgroundThread()
          Gets whether or not a thread should be created and started to handle the background loading, or whether a user thread will call the appropriate hooks.
 void initialise()
          Initialise the background queue system.
 long initialiseAllResourceGroups(IResourceBackgroundQueue.IListener listener)
          Initialise all resource groups which are yet to be initialised in the background.
 long initialiseResourceGroup(java.lang.String name, IResourceBackgroundQueue.IListener listener)
          Initialise a resource group in the background.
 boolean isProcessComplete(long ticket)
          Returns whether a previously queued process has completed or not.
 long load(java.lang.String resType, java.lang.String name, java.lang.String group, boolean isManual, IManualResourceLoader loader, INameValuePairList loadParams, IResourceBackgroundQueue.IListener listener)
          Load a single resource in the background.
 long loadResourceGroup(java.lang.String name, IResourceBackgroundQueue.IListener listener)
          Loads a resource group in the background.
 long prepare(java.lang.String resType, java.lang.String name, java.lang.String group, boolean isManual, IManualResourceLoader loader, INameValuePairList loadParams, IResourceBackgroundQueue.IListener listener)
          Prepare a single resource in the background.
 long prepareResourceGroup(java.lang.String name, IResourceBackgroundQueue.IListener listener)
          Prepares a resource group in the background.
 void setStartBackgroundThread(boolean startThread)
          Sets whether or not a thread should be created and started to handle the background loading, or whether a user thread will call the appropriate hooks.
 void shutdown()
          Shut down the background queue system.
 long unload(java.lang.String resType, long handle, IResourceBackgroundQueue.IListener listener)
          Unload a single resource in the background.
 long unload(java.lang.String resType, java.lang.String name, IResourceBackgroundQueue.IListener listener)
          Unload a single resource in the background.
 long unloadResourceGroup(java.lang.String name, IResourceBackgroundQueue.IListener listener)
          Unloads a resource group in the background.
 
Methods inherited from class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

ResourceBackgroundQueue

public ResourceBackgroundQueue(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


ResourceBackgroundQueue

protected ResourceBackgroundQueue(InstancePointer p,
                                  boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


ResourceBackgroundQueue

public ResourceBackgroundQueue(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()

ResourceBackgroundQueue

public ResourceBackgroundQueue()
Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

setStartBackgroundThread

public void setStartBackgroundThread(boolean startThread)
Sets whether or not a thread should be created and started to handle the background loading, or whether a user thread will call the appropriate hooks.

Specified by:
setStartBackgroundThread in interface IResourceBackgroundQueue

getStartBackgroundThread

public boolean getStartBackgroundThread()
Gets whether or not a thread should be created and started to handle the background loading, or whether a user thread will call the appropriate hooks.

Specified by:
getStartBackgroundThread in interface IResourceBackgroundQueue

initialise

public void initialise()
Initialise the background queue system.

Specified by:
initialise in interface IResourceBackgroundQueue

shutdown

public void shutdown()
Shut down the background queue system.

Specified by:
shutdown in interface IResourceBackgroundQueue

initialiseResourceGroup

public long initialiseResourceGroup(java.lang.String name,
                                    IResourceBackgroundQueue.IListener listener)
Initialise a resource group in the background.

Specified by:
initialiseResourceGroup in interface IResourceBackgroundQueue

initialiseAllResourceGroups

public long initialiseAllResourceGroups(IResourceBackgroundQueue.IListener listener)
Initialise all resource groups which are yet to be initialised in the background.

Specified by:
initialiseAllResourceGroups in interface IResourceBackgroundQueue

prepareResourceGroup

public long prepareResourceGroup(java.lang.String name,
                                 IResourceBackgroundQueue.IListener listener)
Prepares a resource group in the background.

Specified by:
prepareResourceGroup in interface IResourceBackgroundQueue

loadResourceGroup

public long loadResourceGroup(java.lang.String name,
                              IResourceBackgroundQueue.IListener listener)
Loads a resource group in the background.

Specified by:
loadResourceGroup in interface IResourceBackgroundQueue

unload

public long unload(java.lang.String resType,
                   java.lang.String name,
                   IResourceBackgroundQueue.IListener listener)
Unload a single resource in the background.

Specified by:
unload in interface IResourceBackgroundQueue

unload

public long unload(java.lang.String resType,
                   long handle,
                   IResourceBackgroundQueue.IListener listener)
Unload a single resource in the background.

Specified by:
unload in interface IResourceBackgroundQueue

unloadResourceGroup

public long unloadResourceGroup(java.lang.String name,
                                IResourceBackgroundQueue.IListener listener)
Unloads a resource group in the background.

Specified by:
unloadResourceGroup in interface IResourceBackgroundQueue

prepare

public long prepare(java.lang.String resType,
                    java.lang.String name,
                    java.lang.String group,
                    boolean isManual,
                    IManualResourceLoader loader,
                    INameValuePairList loadParams,
                    IResourceBackgroundQueue.IListener listener)
Prepare a single resource in the background.

Specified by:
prepare in interface IResourceBackgroundQueue

load

public long load(java.lang.String resType,
                 java.lang.String name,
                 java.lang.String group,
                 boolean isManual,
                 IManualResourceLoader loader,
                 INameValuePairList loadParams,
                 IResourceBackgroundQueue.IListener listener)
Load a single resource in the background.

Specified by:
load in interface IResourceBackgroundQueue

isProcessComplete

public boolean isProcessComplete(long ticket)
Returns whether a previously queued process has completed or not.

Specified by:
isProcessComplete in interface IResourceBackgroundQueue

_doNextQueuedBackgroundProcess

public boolean _doNextQueuedBackgroundProcess()
Process a single queued background operation.

Specified by:
_doNextQueuedBackgroundProcess in interface IResourceBackgroundQueue

_initThread

public void _initThread()
Initialise processing for a background thread.

Specified by:
_initThread in interface IResourceBackgroundQueue

_queueFireBackgroundPreparingComplete

public void _queueFireBackgroundPreparingComplete(IResource res)
Queue the firing of the 'background preparing complete' event to a event.

Specified by:
_queueFireBackgroundPreparingComplete in interface IResourceBackgroundQueue

_queueFireBackgroundLoadingComplete

public void _queueFireBackgroundLoadingComplete(IResource res)
Queue the firing of the 'background loading complete' event to a event.

Specified by:
_queueFireBackgroundLoadingComplete in interface IResourceBackgroundQueue

_fireOnFrameCallbacks

public void _fireOnFrameCallbacks()
Fires all the queued events for background loaded resources.

Specified by:
_fireOnFrameCallbacks in interface IResourceBackgroundQueue

getSingleton

public static IResourceBackgroundQueue getSingleton()
Override standard retrieval.


getSingletonPtr

public static IResourceBackgroundQueue getSingletonPtr()
Override standard retrieval.



Copyright © 2007 netAllied GmbH. All Rights Reserved.