org.xith3d.resources
Class TextureResourceRequest

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

public class TextureResourceRequest
extends java.lang.Object
implements ResourceRequest

This is a ResourceRequest for a Texture resource to be loaded with TextureLoader.


Constructor Summary
TextureResourceRequest(java.lang.String name, java.lang.String bagName)
          Creates a new TextureResourceRequest.
TextureResourceRequest(java.lang.String name, java.lang.String bagName, org.jagatoo.opengl.enums.TextureFormat format)
          Creates a new TextureResourceRequest.
TextureResourceRequest(java.lang.String name, java.lang.String bagName, org.jagatoo.opengl.enums.TextureFormat format, Texture.MipmapMode mipmapMode)
          Creates a new TextureResourceRequest.
TextureResourceRequest(java.lang.String name, java.lang.String bagName, org.jagatoo.opengl.enums.TextureFormat format, Texture.MipmapMode mipmapMode, boolean flipped)
          Creates a new TextureResourceRequest.
TextureResourceRequest(java.lang.String name, java.lang.String bagName, org.jagatoo.opengl.enums.TextureFormat format, Texture.MipmapMode mipmapMode, boolean flipped, boolean fallbackTextureAccepted)
          Creates a new TextureResourceRequest.
TextureResourceRequest(java.lang.String name, java.lang.String bagName, org.jagatoo.opengl.enums.TextureFormat format, Texture.MipmapMode mipmapMode, boolean flipped, boolean fallbackTextureAccepted, org.jagatoo.loaders.textures.locators.TextureStreamLocator tsl)
          Creates a new TextureResourceRequest.
TextureResourceRequest(java.lang.String name, java.lang.String bagName, org.jagatoo.opengl.enums.TextureFormat format, Texture.MipmapMode mipmapMode, boolean flipped, org.jagatoo.loaders.textures.locators.TextureStreamLocator tsl)
          Creates a new TextureResourceRequest.
TextureResourceRequest(java.lang.String name, java.lang.String bagName, org.jagatoo.opengl.enums.TextureFormat format, Texture.MipmapMode mipmapMode, org.jagatoo.loaders.textures.locators.TextureStreamLocator tsl)
          Creates a new TextureResourceRequest.
TextureResourceRequest(java.lang.String name, java.lang.String bagName, org.jagatoo.opengl.enums.TextureFormat format, org.jagatoo.loaders.textures.locators.TextureStreamLocator tsl)
          Creates a new TextureResourceRequest.
TextureResourceRequest(java.lang.String name, java.lang.String bagName, org.jagatoo.loaders.textures.locators.TextureStreamLocator tsl)
          Creates a new TextureResourceRequest.
 
Method Summary
 boolean fallbackTextureAccepted()
           
 boolean flipped()
           
 org.jagatoo.opengl.enums.TextureFormat format()
           
 java.lang.String getBagName()
          
 java.lang.String getName()
          
 org.jagatoo.loaders.textures.locators.TextureStreamLocator getTSL()
           
 java.lang.Object loadResource(ResourceLocator resLoc, ResourceBag resBag)
          Loads the resource and stores it into the ResourceBag.
 Texture.MipmapMode mipmapMode()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextureResourceRequest

public TextureResourceRequest(java.lang.String name,
                              java.lang.String bagName,
                              org.jagatoo.opengl.enums.TextureFormat format,
                              Texture.MipmapMode mipmapMode,
                              boolean flipped,
                              boolean fallbackTextureAccepted,
                              org.jagatoo.loaders.textures.locators.TextureStreamLocator tsl)
Creates a new TextureResourceRequest.

Parameters:
name - the name of the Texture resource to use for loading
bagName - the name, that the Texture resource will carry in the ResourceBag
format - load alpha channel?
mipmapMode - load mipmap?
flipped - flip the texture vertically?
fallbackTextureAccepted - if false and the fallback Texture was loaded, null is put into the ResourceBag
tsl - the TextureStreamLocator to be used to locate the resource

TextureResourceRequest

public TextureResourceRequest(java.lang.String name,
                              java.lang.String bagName,
                              org.jagatoo.opengl.enums.TextureFormat format,
                              Texture.MipmapMode mipmapMode,
                              boolean flipped,
                              org.jagatoo.loaders.textures.locators.TextureStreamLocator tsl)
Creates a new TextureResourceRequest.

Parameters:
name - the name of the Texture resource to use for loading
bagName - the name, that the Texture resource will carry in the ResourceBag
format - load alpha channel?
mipmapMode - load mipmap?
flipped - flip the texture vertically?
tsl - the TextureStreamLocator to be used to locate the resource

TextureResourceRequest

public TextureResourceRequest(java.lang.String name,
                              java.lang.String bagName,
                              org.jagatoo.opengl.enums.TextureFormat format,
                              Texture.MipmapMode mipmapMode,
                              org.jagatoo.loaders.textures.locators.TextureStreamLocator tsl)
Creates a new TextureResourceRequest.

Parameters:
name - the name of the Texture resource to use for loading
bagName - the name, that the Texture resource will carry in the ResourceBag
format - load alpha channel?
mipmapMode - load mipmap?
tsl - the TextureStreamLocator to be used to locate the resource

TextureResourceRequest

public TextureResourceRequest(java.lang.String name,
                              java.lang.String bagName,
                              org.jagatoo.opengl.enums.TextureFormat format,
                              org.jagatoo.loaders.textures.locators.TextureStreamLocator tsl)
Creates a new TextureResourceRequest.

Parameters:
name - the name of the Texture resource to use for loading
bagName - the name, that the Texture resource will carry in the ResourceBag
format - load alpha channel?
tsl - the TextureStreamLocator to be used to locate the resource

TextureResourceRequest

public TextureResourceRequest(java.lang.String name,
                              java.lang.String bagName,
                              org.jagatoo.loaders.textures.locators.TextureStreamLocator tsl)
Creates a new TextureResourceRequest.

Parameters:
name - the name of the Texture resource to use for loading
bagName - the name, that the Texture resource will carry in the ResourceBag
tsl - the TextureStreamLocator to be used to locate the resource

TextureResourceRequest

public TextureResourceRequest(java.lang.String name,
                              java.lang.String bagName,
                              org.jagatoo.opengl.enums.TextureFormat format,
                              Texture.MipmapMode mipmapMode,
                              boolean flipped,
                              boolean fallbackTextureAccepted)
Creates a new TextureResourceRequest.

Parameters:
name - the name of the Texture resource to use for loading
bagName - the name, that the Texture resource will carry in the ResourceBag
format - load alpha channel?
mipmapMode - load mipmap?
flipped - flip the texture vertically?
fallbackTextureAccepted - if false and the fallback Texture was loaded, null is put into the ResourceBag

TextureResourceRequest

public TextureResourceRequest(java.lang.String name,
                              java.lang.String bagName,
                              org.jagatoo.opengl.enums.TextureFormat format,
                              Texture.MipmapMode mipmapMode,
                              boolean flipped)
Creates a new TextureResourceRequest.

Parameters:
name - the name of the Texture resource to use for loading
bagName - the name, that the Texture resource will carry in the ResourceBag
format - load alpha channel?
mipmapMode - load mipmap?
flipped - flip the texture vertically?

TextureResourceRequest

public TextureResourceRequest(java.lang.String name,
                              java.lang.String bagName,
                              org.jagatoo.opengl.enums.TextureFormat format,
                              Texture.MipmapMode mipmapMode)
Creates a new TextureResourceRequest.

Parameters:
name - the name of the Texture resource to use for loading
bagName - the name, that the Texture resource will carry in the ResourceBag
format - load alpha channel?
mipmapMode - load mipmap?

TextureResourceRequest

public TextureResourceRequest(java.lang.String name,
                              java.lang.String bagName,
                              org.jagatoo.opengl.enums.TextureFormat format)
Creates a new TextureResourceRequest.

Parameters:
name - the name of the Texture resource to use for loading
bagName - the name, that the Texture resource will carry in the ResourceBag
format - load alpha channel?

TextureResourceRequest

public TextureResourceRequest(java.lang.String name,
                              java.lang.String bagName)
Creates a new TextureResourceRequest.

Parameters:
name - the name of the Texture resource to use for loading
bagName - the name, that the Texture resource will carry in the ResourceBag
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

flipped

public final boolean flipped()
Returns:
if the Texture resource is to be flipped vertically

format

public final org.jagatoo.opengl.enums.TextureFormat format()
Returns:
the basic format of the Texture (RGB, RGBA, ...)

mipmapMode

public final Texture.MipmapMode mipmapMode()
Returns:
if the Texture resource is to be loaded with mipmap

fallbackTextureAccepted

public final boolean fallbackTextureAccepted()
Returns:
if false and the fallback Texture was loaded, null is put into the ResourceBag

getTSL

public final org.jagatoo.loaders.textures.locators.TextureStreamLocator getTSL()
Returns:
the TextureStreamLocator used to load this Texture resource (or null)

loadResource

public java.lang.Object loadResource(ResourceLocator resLoc,
                                     ResourceBag resBag)
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.