Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.texture
Interface AVTextureCache

All Superinterfaces:
org.j3d.texture.TextureCache
All Known Implementing Classes:
AbstractTextureCache

public interface AVTextureCache
extends org.j3d.texture.TextureCache

A representation of global cache for texture instance management.

The cache works at the Aviatrix Texture or TextureComponent instance level rather than down at the individual images. This allows the VM to discard the lower level image instances if needed, allowing Java3D to do its own management. In addition, it benefits runtime performance of the Java3D scene graph by allowing textures instances to be shared, rather than duplicated.

Different types of cache implementations are allowed (ie different ways of deciding when an texture no longer needs to be in the cache).

Internal storage and key management is using strings. The URLs are converted to string form as the key and used to look up items. The filenames are always relative to the classpath. If the filename/url has been loaded as an image component before and then a request is made for a texture, then the previously loaded component is used as the basis for the texture.

All fetch methods work in the same way - if the texture has not been previously loaded, then it will be loaded and converted to a BufferedImage using the utilities of this class.

Version:
$Revision: 1.5 $
Author:
Alan Hudson

Method Summary
 boolean checkTextureComponent(java.lang.String filename)
          Check to see if a filename is cached for an TextureComponent.
 Texture fetchTexture(java.lang.String filename)
          Fetch the texture named by the filename.
 Texture fetchTexture(java.net.URL url)
          Fetch the texture named by the URL.
 TextureComponent fetchTextureComponent(java.lang.String filename)
          Param fetch the imagecomponent named by the filename.
 TextureComponent fetchTextureComponent(java.net.URL url)
          Fetch the image component named by the URL.
 void registerTexture(Texture texture, java.lang.String filename)
          Register a texture with the cache assigned to a filename.
 void registerTextureComponent(TextureComponent component, java.lang.String filename)
          Register an imagecomponent with the cache assigned to a filename.
 
Methods inherited from interface org.j3d.texture.TextureCache
checkTexture, clearAll, releaseTexture, releaseTexture
 

Method Detail

fetchTexture

Texture fetchTexture(java.lang.String filename)
                     throws java.io.IOException
Fetch the texture named by the filename. The filename may be either absolute or relative to the classpath.

Parameters:
filename - The filename to fetch
Returns:
The texture instance for that filename
Throws:
java.io.IOException - An I/O error occurred during loading

fetchTexture

Texture fetchTexture(java.net.URL url)
                     throws java.io.IOException
Fetch the texture named by the URL.

Parameters:
url - The URL to read data from
Returns:
The texture instance for that URL
Throws:
java.io.IOException - An I/O error occurred during loading

fetchTextureComponent

TextureComponent fetchTextureComponent(java.lang.String filename)
                                       throws java.io.IOException
Param fetch the imagecomponent named by the filename. The filename may be either absolute or relative to the classpath.

Parameters:
filename - The filename to fetch
Returns:
The TextureComponent instance for that filename
Throws:
java.io.IOException - An I/O error occurred during loading

fetchTextureComponent

TextureComponent fetchTextureComponent(java.net.URL url)
                                       throws java.io.IOException
Fetch the image component named by the URL.

Parameters:
url - The URL to read data from
Returns:
The TextureComponent instance for that URL
Throws:
java.io.IOException - An I/O error occurred during loading

checkTextureComponent

boolean checkTextureComponent(java.lang.String filename)
Check to see if a filename is cached for an TextureComponent.

Parameters:
filename - The filename loaded
Returns:
Whether the filename is cached as an TextureComponent

registerTexture

void registerTexture(Texture texture,
                     java.lang.String filename)
Register a texture with the cache assigned to a filename.

Parameters:
texture - The texture to store
filename - The filename to register

registerTextureComponent

void registerTextureComponent(TextureComponent component,
                              java.lang.String filename)
Register an imagecomponent with the cache assigned to a filename.

Parameters:
component - The texture to store
filename - The filename to register

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org