org.xith3d.resources
Class ShaderResourceRequest

java.lang.Object
  extended by org.xith3d.resources.ShaderResourceRequest
All Implemented Interfaces:
org.jagatoo.datatypes.NamedObject, ResourceRequest

public class ShaderResourceRequest
extends java.lang.Object
implements ResourceRequest

This is a ResourceRequest for a Shader resource to be loaded with ShaderLoader.


Constructor Summary
ShaderResourceRequest(java.lang.String name, java.lang.String bagName, Shader.ShaderType type, ShaderLoader<?> loader)
          Creates a new ShaderResourceRequest.
ShaderResourceRequest(java.lang.String name, java.lang.String bagName, Shader.ShaderType type, java.net.URL baseURL, ShaderLoader<?> loader)
          Creates a new ShaderResourceRequest.
 
Method Summary
 java.lang.String getBagName()
          
 java.net.URL getBaseURL()
           
 java.lang.String getName()
          
 ShaderLoader<?> getShaderLoader()
           
 Shader.ShaderType getType()
           
 java.lang.Object loadResource(ResourceLocator resLoc, ResourceBag resBag)
          Loads the resource and stores it into the ResourceBag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShaderResourceRequest

public ShaderResourceRequest(java.lang.String name,
                             java.lang.String bagName,
                             Shader.ShaderType type,
                             java.net.URL baseURL,
                             ShaderLoader<?> loader)
Creates a new ShaderResourceRequest.

Parameters:
name - the name of the requested Model resource
bagName - the name of the requested resource, that it will carry in the ResourceBag
type - the ShaderType to use
baseURL - the base URL to use while loading (or null to get from model URL)
loader - the ShaderLoader used to load this Sahder resource (or null to use the ExtensionLoader)

ShaderResourceRequest

public ShaderResourceRequest(java.lang.String name,
                             java.lang.String bagName,
                             Shader.ShaderType type,
                             ShaderLoader<?> loader)
Creates a new ShaderResourceRequest.

Parameters:
name - the name of the requested Model resource
bagName - the name of the requested resource, that it will carry in the ResourceBag
type - the ShaderType to use
loader - the ShaderLoader used to load this Sahder resource (or null to use the ExtensionLoader)
Method Detail

getName

public final java.lang.String getName()

Specified by:
getName in interface org.jagatoo.datatypes.NamedObject
Specified by:
getName in interface ResourceRequest
Returns:
the name of the requested resource

getBagName

public final java.lang.String getBagName()

Specified by:
getBagName in interface ResourceRequest
Returns:
the name of the requested resource, that it will carry in the ResourceBag

getType

public final Shader.ShaderType getType()
Returns:
the load flags to be used to load this Model

getBaseURL

public final java.net.URL getBaseURL()
Returns:
the base URL to use while loading (or null to get from model URL)

getShaderLoader

public final ShaderLoader<?> getShaderLoader()
Returns:
the ShaderLoader used to load this Shader resource

loadResource

public java.lang.Object loadResource(ResourceLocator resLoc,
                                     ResourceBag resBag)
                              throws java.io.IOException
Loads the resource and stores it into the ResourceBag.

Specified by:
loadResource in interface ResourceRequest
Parameters:
resLoc - the ResourceLocator to load resources from
resBag - the ResourceBag to store the loaded resource to
Returns:
the loaded resource.
Throws:
java.io.IOException