|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AVTextureCache
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.
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 |
---|
Texture fetchTexture(java.lang.String filename) throws java.io.IOException
filename
- The filename to fetch
java.io.IOException
- An I/O error occurred during loadingTexture fetchTexture(java.net.URL url) throws java.io.IOException
url
- The URL to read data from
java.io.IOException
- An I/O error occurred during loadingTextureComponent fetchTextureComponent(java.lang.String filename) throws java.io.IOException
filename
- The filename to fetch
java.io.IOException
- An I/O error occurred during loadingTextureComponent fetchTextureComponent(java.net.URL url) throws java.io.IOException
url
- The URL to read data from
java.io.IOException
- An I/O error occurred during loadingboolean checkTextureComponent(java.lang.String filename)
filename
- The filename loaded
void registerTexture(Texture texture, java.lang.String filename)
texture
- The texture to storefilename
- The filename to registervoid registerTextureComponent(TextureComponent component, java.lang.String filename)
component
- The texture to storefilename
- The filename to register
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |