|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectComponent3D
edu.cmu.sun.components.ImageComponent
public class ImageComponent
A Component3D object that replaces the ImagePanel Shape3D that LG3D provides. This panel is alligned upper-left-front. Much od the code in this class is taken from ImagePanel in LG3D. However, this class also CACHES acess to the images. This means that every time you create an image panel the system does not have to hit the disk. This dramatically speeds up the placing of many duplicate images in the scenegraph. At the moment, there is no way to clear the image cache, or remoive a loaded image from the cache. In the future, perhaps we could use a Factory object to create ImageComponents. The Factory could be responsible for caching image loads.
| Field Summary | |
|---|---|
(package private) float |
alpha
TODO: change this to a constant somewhere. |
(package private) static java.util.Map<java.lang.String,SimpleAppearance> |
appearances
A map from the filename string and the SimpleAppearance that contains the texture. |
(package private) boolean |
shiny
Field that is passed directly to the ImagePanel compoennt |
| Constructor Summary | |
|---|---|
ImageComponent(java.lang.String imagePath,
float width,
float height)
Create a new ImageComponent for an image file. |
|
| Method Summary | |
|---|---|
private SimpleAppearance |
getAppearance(java.lang.String textureFilePath)
Returns the appearance for a panel, with the provided texture. |
private Geometry |
getGeometry(float width,
float height)
returns the geometry of a simple panel for the image component to be drawn on. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static java.util.Map<java.lang.String,SimpleAppearance> appearances
boolean shiny
float alpha
| Constructor Detail |
|---|
public ImageComponent(java.lang.String imagePath,
float width,
float height)
imagePath - file path to the imagewidth - width of resulting panel (in meters)height - height of resulting panel (in meters)| Method Detail |
|---|
private Geometry getGeometry(float width,
float height)
private SimpleAppearance getAppearance(java.lang.String textureFilePath)
textureFilePath - path to the texture file
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||