org.ogre4j
Class ResourceGroupManager

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

public class ResourceGroupManager
extends NativeObject
implements IResourceGroupManager


Nested Class Summary
protected static class ResourceGroupManager.LoadUnloadResourceList
           
protected static class ResourceGroupManager.LocationList
           
static class ResourceGroupManager.ResourceDeclaration
           
static class ResourceGroupManager.ResourceDeclarationList
           
protected static class ResourceGroupManager.ResourceGroup
           
protected static class ResourceGroupManager.ResourceGroupListenerList
           
protected static class ResourceGroupManager.ResourceGroupMap
           
protected static class ResourceGroupManager.ResourceLocation
           
protected static class ResourceGroupManager.ResourceLocationIndex
           
static class ResourceGroupManager.ResourceManagerIterator
           
static class ResourceGroupManager.ResourceManagerMap
           
protected static class ResourceGroupManager.ScriptLoaderOrderMap
           
 
Nested classes/interfaces inherited from interface org.ogre4j.IResourceGroupManager
IResourceGroupManager.ILoadUnloadResourceList, IResourceGroupManager.ILocationList, IResourceGroupManager.IResourceDeclaration, IResourceGroupManager.IResourceDeclarationList, IResourceGroupManager.IResourceGroup, IResourceGroupManager.IResourceGroupListenerList, IResourceGroupManager.IResourceGroupMap, IResourceGroupManager.IResourceLocation, IResourceGroupManager.IResourceLocationIndex, IResourceGroupManager.IResourceManagerIterator, IResourceGroupManager.IResourceManagerMap, IResourceGroupManager.IScriptLoaderOrderMap
 
Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  ResourceGroupManager()
           
  ResourceGroupManager(InstancePointer p)
          This constructor is public for internal useage only!
protected ResourceGroupManager(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  ResourceGroupManager(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 IResourceManager _getResourceManager(java.lang.String resourceType)
          Internal method for getting a registered .
 void _notifyAllResourcesRemoved(IResourceManager manager)
          Internal method called by when all resources for that manager are removed.
 void _notifyResourceCreated(IResourcePtr res)
          Internal method called by when a resource is created.
 void _notifyResourceGroupChanged(java.lang.String oldGroup, IResource res)
          Internal method to notify the group manager that a resource has changed group (only applicable for autodetect group)
 void _notifyResourceRemoved(IResourcePtr res)
          Internal method called by when a resource is removed.
 void _notifyWorldGeometryPrepareStageEnded()
          Notify this manager that one stage of world geometry loading has been completed.
 void _notifyWorldGeometryPrepareStageStarted(java.lang.String description)
          Notify this manager that one stage of world geometry loading has been started.
 void _notifyWorldGeometryStageEnded()
          Notify this manager that one stage of world geometry loading has been completed.
 void _notifyWorldGeometryStageStarted(java.lang.String description)
          Notify this manager that one stage of world geometry loading has been started.
 void _registerResourceManager(java.lang.String resourceType, IResourceManager rm)
          Internal method for registering a (which should be a singleton).
 void _registerScriptLoader(IScriptLoader su)
          Internal method for registering a .
 void _unregisterResourceManager(java.lang.String resourceType)
          Internal method for unregistering a .
 void _unregisterScriptLoader(IScriptLoader su)
          Internal method for unregistering a .
 void addResourceGroupListener(IResourceGroupListener l)
          Adds a which will be called back during resource loading events.
 void addResourceLocation(java.lang.String name, java.lang.String locType, java.lang.String resGroup, boolean recursive)
          Method to add a resource location to for a given resource group.
 void clearResourceGroup(java.lang.String name)
          Clears a resource group.
 void createResourceGroup(java.lang.String name)
          Create a resource group.
 void declareResource(java.lang.String name, java.lang.String resourceType, java.lang.String groupName, IManualResourceLoader loader, INameValuePairList loadParameters)
          Declares a resource to be a part of a resource group, allowing you to load and unload it as part of the group.
 void declareResource(java.lang.String name, java.lang.String resourceType, java.lang.String groupName, INameValuePairList loadParameters)
          Declares a resource to be a part of a resource group, allowing you to load and unload it as part of the group.
 void delete()
          Deletes the corresponding C++ object.
 void destroyResourceGroup(java.lang.String name)
          Destroys a resource group, clearing it first, destroying the resources which are part of it, and then removing it from the list of resource groups.
 void finalize()
           
 java.lang.String findGroupContainingResource(java.lang.String filename)
          Find the group in which a resource exists.
 void findResourceFileInfo(IFileInfoListPtr returnValue, java.lang.String group, java.lang.String pattern, boolean dirs)
          Find all files or directories matching a given pattern in a group and get some detailed information about them.
 void findResourceNames(IStringVectorPtr returnValue, java.lang.String groupName, java.lang.String pattern, boolean dirs)
          Find all file or directory names matching a given pattern in a resource group.
static java.lang.String getAUTODETECT_RESOURCE_GROUP_NAME()
           
static java.lang.String getBOOTSTRAP_RESOURCE_GROUP_NAME()
           
static java.lang.String getDEFAULT_RESOURCE_GROUP_NAME()
           
static java.lang.String getINTERNAL_RESOURCE_GROUP_NAME()
           
 IResourceLoadingListener getLoadingListener()
           
static int getRESOURCE_SYSTEM_NUM_REFERENCE_COUNTS()
           
 void getResourceDeclarationList(IResourceGroupManager.IResourceDeclarationList returnValue, java.lang.String groupName)
          Get the list of resource declarations for the specified group name.
 void getResourceGroups(IStringVector returnValue)
          Get a list of the currently defined resource groups.
 void getResourceManagerIterator(IResourceGroupManager.IResourceManagerIterator returnValue)
          Get an iterator over the registered resource managers.
static IResourceGroupManager getSingleton()
          Override standard retrieval.
static IResourceGroupManager getSingletonPtr()
          Override standard retrieval.
 java.lang.String getWorldResourceGroupName()
           
 void initialiseAllResourceGroups()
          Initialise all resource groups which are yet to be initialised.
 void initialiseResourceGroup(java.lang.String name)
          Initialises a resource group.
 boolean isResourceGroupInitialised(java.lang.String name)
          Checks the status of a resource group.
 boolean isResourceGroupLoaded(java.lang.String name)
          Checks the status of a resource group.
 void linkWorldGeometryToResourceGroup(java.lang.String group, java.lang.String worldGeometry, ISceneManager sceneManager)
          Associates some world geometry with a resource group, causing it to be loaded / unloaded with the resource group.
 void listResourceFileInfo(IFileInfoListPtr returnValue, java.lang.String groupName, boolean dirs)
          List all files in a resource group with accompanying information.
 void listResourceNames(IStringVectorPtr returnValue, java.lang.String groupName, boolean dirs)
          List all file or directory names in a resource group.
 void loadResourceGroup(java.lang.String name, boolean loadMainResources, boolean loadWorldGeom)
          Loads a resource group.
 void openResource(IDataStreamPtr returnValue, java.lang.String resourceName, java.lang.String groupName, boolean searchGroupsIfNotFound, IResource resourceBeingLoaded)
          Open a single resource by name and return a pointing at the source of the data.
 void openResources(IDataStreamListPtr returnValue, java.lang.String pattern, java.lang.String groupName)
          Open all resources matching a given pattern (which can contain the character '*' as a wildcard), and return a collection of objects on them.
 void prepareResourceGroup(java.lang.String name, boolean prepareMainResources, boolean prepareWorldGeom)
          Prepares a resource group.
 void removeResourceGroupListener(IResourceGroupListener l)
          Removes a
 void removeResourceLocation(java.lang.String name, java.lang.String resGroup)
          Removes a resource location from the search path.
 boolean resourceExists(IResourceGroupManager.IResourceGroup group, java.lang.String filename)
          Find out if the named file exists in a group.
 boolean resourceExists(java.lang.String group, java.lang.String filename)
          Find out if the named file exists in a group.
 long resourceModifiedTime(IResourceGroupManager.IResourceGroup group, java.lang.String filename)
          Retrieve the modification time of a given file
 long resourceModifiedTime(java.lang.String group, java.lang.String filename)
          Retrieve the modification time of a given file
static void setAUTODETECT_RESOURCE_GROUP_NAME(java.lang.String _jni_value_)
           
static void setBOOTSTRAP_RESOURCE_GROUP_NAME(java.lang.String _jni_value_)
           
static void setDEFAULT_RESOURCE_GROUP_NAME(java.lang.String _jni_value_)
           
static void setINTERNAL_RESOURCE_GROUP_NAME(java.lang.String _jni_value_)
           
 void setLoadingListener(IResourceLoadingListener listener)
           
static void setRESOURCE_SYSTEM_NUM_REFERENCE_COUNTS(int _jni_value_)
           
 void setWorldResourceGroupName(java.lang.String groupName)
          Sets the resource group that 'world' resources will use.
 void shutdownAll()
          Shutdown all ResourceManagers, performed as part of clean-up.
 void undeclareResource(java.lang.String name, java.lang.String groupName)
          Undeclare a resource.
 void unlinkWorldGeometryFromResourceGroup(java.lang.String group)
          Clear any link to world geometry from a resource group.
 void unloadResourceGroup(java.lang.String name, boolean reloadableOnly)
          Unloads a resource group.
 void unloadUnreferencedResourcesInGroup(java.lang.String name, boolean reloadableOnly)
          Unload all resources which are not referenced by any other object.
 
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

ResourceGroupManager

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


ResourceGroupManager

protected ResourceGroupManager(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.


ResourceGroupManager

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

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()

ResourceGroupManager

public ResourceGroupManager()
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

createResourceGroup

public void createResourceGroup(java.lang.String name)
Create a resource group.

Specified by:
createResourceGroup in interface IResourceGroupManager

initialiseResourceGroup

public void initialiseResourceGroup(java.lang.String name)
Initialises a resource group.

Specified by:
initialiseResourceGroup in interface IResourceGroupManager

initialiseAllResourceGroups

public void initialiseAllResourceGroups()
Initialise all resource groups which are yet to be initialised.

Specified by:
initialiseAllResourceGroups in interface IResourceGroupManager

prepareResourceGroup

public void prepareResourceGroup(java.lang.String name,
                                 boolean prepareMainResources,
                                 boolean prepareWorldGeom)
Prepares a resource group. When this method is called, this class will callback any ResourceGroupListeners which have been registered to update them on progress.

Specified by:
prepareResourceGroup in interface IResourceGroupManager

loadResourceGroup

public void loadResourceGroup(java.lang.String name,
                              boolean loadMainResources,
                              boolean loadWorldGeom)
Loads a resource group. When this method is called, this class will callback any ResourceGroupListeners which have been registered to update them on progress.

Specified by:
loadResourceGroup in interface IResourceGroupManager

unloadResourceGroup

public void unloadResourceGroup(java.lang.String name,
                                boolean reloadableOnly)
Unloads a resource group.

Specified by:
unloadResourceGroup in interface IResourceGroupManager

unloadUnreferencedResourcesInGroup

public void unloadUnreferencedResourcesInGroup(java.lang.String name,
                                               boolean reloadableOnly)
Unload all resources which are not referenced by any other object.

Specified by:
unloadUnreferencedResourcesInGroup in interface IResourceGroupManager

clearResourceGroup

public void clearResourceGroup(java.lang.String name)
Clears a resource group.

Specified by:
clearResourceGroup in interface IResourceGroupManager

destroyResourceGroup

public void destroyResourceGroup(java.lang.String name)
Destroys a resource group, clearing it first, destroying the resources which are part of it, and then removing it from the list of resource groups.

Specified by:
destroyResourceGroup in interface IResourceGroupManager

isResourceGroupInitialised

public boolean isResourceGroupInitialised(java.lang.String name)
Checks the status of a resource group.

Specified by:
isResourceGroupInitialised in interface IResourceGroupManager

isResourceGroupLoaded

public boolean isResourceGroupLoaded(java.lang.String name)
Checks the status of a resource group.

Specified by:
isResourceGroupLoaded in interface IResourceGroupManager

addResourceLocation

public void addResourceLocation(java.lang.String name,
                                java.lang.String locType,
                                java.lang.String resGroup,
                                boolean recursive)
Method to add a resource location to for a given resource group.

Specified by:
addResourceLocation in interface IResourceGroupManager

removeResourceLocation

public void removeResourceLocation(java.lang.String name,
                                   java.lang.String resGroup)
Removes a resource location from the search path.

Specified by:
removeResourceLocation in interface IResourceGroupManager

declareResource

public void declareResource(java.lang.String name,
                            java.lang.String resourceType,
                            java.lang.String groupName,
                            INameValuePairList loadParameters)
Declares a resource to be a part of a resource group, allowing you to load and unload it as part of the group.

Specified by:
declareResource in interface IResourceGroupManager

declareResource

public void declareResource(java.lang.String name,
                            java.lang.String resourceType,
                            java.lang.String groupName,
                            IManualResourceLoader loader,
                            INameValuePairList loadParameters)
Declares a resource to be a part of a resource group, allowing you to load and unload it as part of the group.

Specified by:
declareResource in interface IResourceGroupManager

undeclareResource

public void undeclareResource(java.lang.String name,
                              java.lang.String groupName)
Undeclare a resource.

Specified by:
undeclareResource in interface IResourceGroupManager

openResource

public void openResource(IDataStreamPtr returnValue,
                         java.lang.String resourceName,
                         java.lang.String groupName,
                         boolean searchGroupsIfNotFound,
                         IResource resourceBeingLoaded)
Open a single resource by name and return a pointing at the source of the data.

Specified by:
openResource in interface IResourceGroupManager

openResources

public void openResources(IDataStreamListPtr returnValue,
                          java.lang.String pattern,
                          java.lang.String groupName)
Open all resources matching a given pattern (which can contain the character '*' as a wildcard), and return a collection of objects on them.

Specified by:
openResources in interface IResourceGroupManager

listResourceNames

public void listResourceNames(IStringVectorPtr returnValue,
                              java.lang.String groupName,
                              boolean dirs)
List all file or directory names in a resource group.

Specified by:
listResourceNames in interface IResourceGroupManager

listResourceFileInfo

public void listResourceFileInfo(IFileInfoListPtr returnValue,
                                 java.lang.String groupName,
                                 boolean dirs)
List all files in a resource group with accompanying information.

Specified by:
listResourceFileInfo in interface IResourceGroupManager

findResourceNames

public void findResourceNames(IStringVectorPtr returnValue,
                              java.lang.String groupName,
                              java.lang.String pattern,
                              boolean dirs)
Find all file or directory names matching a given pattern in a resource group.

Specified by:
findResourceNames in interface IResourceGroupManager

resourceExists

public boolean resourceExists(java.lang.String group,
                              java.lang.String filename)
Find out if the named file exists in a group.

Specified by:
resourceExists in interface IResourceGroupManager

resourceExists

public boolean resourceExists(IResourceGroupManager.IResourceGroup group,
                              java.lang.String filename)
Find out if the named file exists in a group.

Specified by:
resourceExists in interface IResourceGroupManager

findGroupContainingResource

public java.lang.String findGroupContainingResource(java.lang.String filename)
Find the group in which a resource exists.

Specified by:
findGroupContainingResource in interface IResourceGroupManager

findResourceFileInfo

public void findResourceFileInfo(IFileInfoListPtr returnValue,
                                 java.lang.String group,
                                 java.lang.String pattern,
                                 boolean dirs)
Find all files or directories matching a given pattern in a group and get some detailed information about them.

Specified by:
findResourceFileInfo in interface IResourceGroupManager

resourceModifiedTime

public long resourceModifiedTime(java.lang.String group,
                                 java.lang.String filename)
Retrieve the modification time of a given file

Specified by:
resourceModifiedTime in interface IResourceGroupManager

resourceModifiedTime

public long resourceModifiedTime(IResourceGroupManager.IResourceGroup group,
                                 java.lang.String filename)
Retrieve the modification time of a given file

Specified by:
resourceModifiedTime in interface IResourceGroupManager

addResourceGroupListener

public void addResourceGroupListener(IResourceGroupListener l)
Adds a which will be called back during resource loading events.

Specified by:
addResourceGroupListener in interface IResourceGroupManager

removeResourceGroupListener

public void removeResourceGroupListener(IResourceGroupListener l)
Removes a

Specified by:
removeResourceGroupListener in interface IResourceGroupManager

setWorldResourceGroupName

public void setWorldResourceGroupName(java.lang.String groupName)
Sets the resource group that 'world' resources will use.

Specified by:
setWorldResourceGroupName in interface IResourceGroupManager

getWorldResourceGroupName

public java.lang.String getWorldResourceGroupName()
Specified by:
getWorldResourceGroupName in interface IResourceGroupManager

linkWorldGeometryToResourceGroup

public void linkWorldGeometryToResourceGroup(java.lang.String group,
                                             java.lang.String worldGeometry,
                                             ISceneManager sceneManager)
Associates some world geometry with a resource group, causing it to be loaded / unloaded with the resource group.

Specified by:
linkWorldGeometryToResourceGroup in interface IResourceGroupManager

unlinkWorldGeometryFromResourceGroup

public void unlinkWorldGeometryFromResourceGroup(java.lang.String group)
Clear any link to world geometry from a resource group.

Specified by:
unlinkWorldGeometryFromResourceGroup in interface IResourceGroupManager

shutdownAll

public void shutdownAll()
Shutdown all ResourceManagers, performed as part of clean-up.

Specified by:
shutdownAll in interface IResourceGroupManager

_registerResourceManager

public void _registerResourceManager(java.lang.String resourceType,
                                     IResourceManager rm)
Internal method for registering a (which should be a singleton). Creators of plugins can register new ResourceManagers this way if they wish.

Specified by:
_registerResourceManager in interface IResourceGroupManager

_unregisterResourceManager

public void _unregisterResourceManager(java.lang.String resourceType)
Internal method for unregistering a .

Specified by:
_unregisterResourceManager in interface IResourceGroupManager

getResourceManagerIterator

public void getResourceManagerIterator(IResourceGroupManager.IResourceManagerIterator returnValue)
Get an iterator over the registered resource managers.

Specified by:
getResourceManagerIterator in interface IResourceGroupManager

_registerScriptLoader

public void _registerScriptLoader(IScriptLoader su)
Internal method for registering a .

Specified by:
_registerScriptLoader in interface IResourceGroupManager

_unregisterScriptLoader

public void _unregisterScriptLoader(IScriptLoader su)
Internal method for unregistering a .

Specified by:
_unregisterScriptLoader in interface IResourceGroupManager

_getResourceManager

public IResourceManager _getResourceManager(java.lang.String resourceType)
Internal method for getting a registered .

Specified by:
_getResourceManager in interface IResourceGroupManager

_notifyResourceCreated

public void _notifyResourceCreated(IResourcePtr res)
Internal method called by when a resource is created.

Specified by:
_notifyResourceCreated in interface IResourceGroupManager

_notifyResourceRemoved

public void _notifyResourceRemoved(IResourcePtr res)
Internal method called by when a resource is removed.

Specified by:
_notifyResourceRemoved in interface IResourceGroupManager

_notifyResourceGroupChanged

public void _notifyResourceGroupChanged(java.lang.String oldGroup,
                                        IResource res)
Internal method to notify the group manager that a resource has changed group (only applicable for autodetect group)

Specified by:
_notifyResourceGroupChanged in interface IResourceGroupManager

_notifyAllResourcesRemoved

public void _notifyAllResourcesRemoved(IResourceManager manager)
Internal method called by when all resources for that manager are removed.

Specified by:
_notifyAllResourcesRemoved in interface IResourceGroupManager

_notifyWorldGeometryPrepareStageStarted

public void _notifyWorldGeometryPrepareStageStarted(java.lang.String description)
Notify this manager that one stage of world geometry loading has been started.

Specified by:
_notifyWorldGeometryPrepareStageStarted in interface IResourceGroupManager

_notifyWorldGeometryPrepareStageEnded

public void _notifyWorldGeometryPrepareStageEnded()
Notify this manager that one stage of world geometry loading has been completed.

Specified by:
_notifyWorldGeometryPrepareStageEnded in interface IResourceGroupManager

_notifyWorldGeometryStageStarted

public void _notifyWorldGeometryStageStarted(java.lang.String description)
Notify this manager that one stage of world geometry loading has been started.

Specified by:
_notifyWorldGeometryStageStarted in interface IResourceGroupManager

_notifyWorldGeometryStageEnded

public void _notifyWorldGeometryStageEnded()
Notify this manager that one stage of world geometry loading has been completed.

Specified by:
_notifyWorldGeometryStageEnded in interface IResourceGroupManager

getResourceGroups

public void getResourceGroups(IStringVector returnValue)
Get a list of the currently defined resource groups.

Specified by:
getResourceGroups in interface IResourceGroupManager

getResourceDeclarationList

public void getResourceDeclarationList(IResourceGroupManager.IResourceDeclarationList returnValue,
                                       java.lang.String groupName)
Get the list of resource declarations for the specified group name.

Specified by:
getResourceDeclarationList in interface IResourceGroupManager

setLoadingListener

public void setLoadingListener(IResourceLoadingListener listener)
Specified by:
setLoadingListener in interface IResourceGroupManager

getLoadingListener

public IResourceLoadingListener getLoadingListener()
Specified by:
getLoadingListener in interface IResourceGroupManager

getSingleton

public static IResourceGroupManager getSingleton()
Override standard retrieval.


getSingletonPtr

public static IResourceGroupManager getSingletonPtr()
Override standard retrieval.


getDEFAULT_RESOURCE_GROUP_NAME

public static java.lang.String getDEFAULT_RESOURCE_GROUP_NAME()

setDEFAULT_RESOURCE_GROUP_NAME

public static void setDEFAULT_RESOURCE_GROUP_NAME(java.lang.String _jni_value_)

getINTERNAL_RESOURCE_GROUP_NAME

public static java.lang.String getINTERNAL_RESOURCE_GROUP_NAME()

setINTERNAL_RESOURCE_GROUP_NAME

public static void setINTERNAL_RESOURCE_GROUP_NAME(java.lang.String _jni_value_)

getBOOTSTRAP_RESOURCE_GROUP_NAME

public static java.lang.String getBOOTSTRAP_RESOURCE_GROUP_NAME()

setBOOTSTRAP_RESOURCE_GROUP_NAME

public static void setBOOTSTRAP_RESOURCE_GROUP_NAME(java.lang.String _jni_value_)

getAUTODETECT_RESOURCE_GROUP_NAME

public static java.lang.String getAUTODETECT_RESOURCE_GROUP_NAME()

setAUTODETECT_RESOURCE_GROUP_NAME

public static void setAUTODETECT_RESOURCE_GROUP_NAME(java.lang.String _jni_value_)

getRESOURCE_SYSTEM_NUM_REFERENCE_COUNTS

public static int getRESOURCE_SYSTEM_NUM_REFERENCE_COUNTS()

setRESOURCE_SYSTEM_NUM_REFERENCE_COUNTS

public static void setRESOURCE_SYSTEM_NUM_REFERENCE_COUNTS(int _jni_value_)


Copyright © 2007 netAllied GmbH. All Rights Reserved.