org.xith3d.resources
Class ResourceLoader

java.lang.Object
  extended by org.xith3d.resources.ResourceLoader

public class ResourceLoader
extends java.lang.Object

The ResourceLoader loads requested resources and can update a progress.


Constructor Summary
ResourceLoader()
           
ResourceLoader(ResourceLocator resLoc)
           
 
Method Summary
 void addRequest(ResourceRequest resReq)
          Adds a ResourceRequest to the queue.
 void addResourceLoaderListener(ResourceLoaderListener l)
           
 ResourceLocator getResourceLocator()
           
protected  boolean loadResource(ResourceRequest resReq, ResourceBag resBag)
          Loads one Resource and adds it to the ResourceBag.
 ResourceBag loadResources()
          Loads all queued resources and puts them into a new ResourceBag.
 ResourceBag loadResources(LoadingScreenUpdater lsu)
          Loads all queued resources and puts them into a new ResourceBag.
 int numRequests()
           
 void removeResourceLoaderListener(ResourceLoaderListener l)
           
 void setResourceLocator(ResourceLocator resLoc)
          Sets the ResourceLocator to be used for resource location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceLoader

public ResourceLoader(ResourceLocator resLoc)

ResourceLoader

public ResourceLoader()
Method Detail

setResourceLocator

public void setResourceLocator(ResourceLocator resLoc)
Sets the ResourceLocator to be used for resource location.

Parameters:
resLoc -

getResourceLocator

public ResourceLocator getResourceLocator()
Returns:
the ResourceLocator to be used for resource location

addResourceLoaderListener

public void addResourceLoaderListener(ResourceLoaderListener l)

removeResourceLoaderListener

public void removeResourceLoaderListener(ResourceLoaderListener l)

addRequest

public void addRequest(ResourceRequest resReq)
Adds a ResourceRequest to the queue.

Parameters:
resReq -

numRequests

public final int numRequests()
Returns:
the number of ResourceRequests queued in this ResourceLoader

loadResource

protected boolean loadResource(ResourceRequest resReq,
                               ResourceBag resBag)
Loads one Resource and adds it to the ResourceBag.

Throws:
java.lang.Throwable

loadResources

public ResourceBag loadResources(LoadingScreenUpdater lsu)
Loads all queued resources and puts them into a new ResourceBag.

Parameters:
lsu - the LoadingScreenUpdater to notify of progress update
Returns:
the filled ResourceBag

loadResources

public ResourceBag loadResources()
Loads all queued resources and puts them into a new ResourceBag.

Returns:
the filled ResourceBag