org.jrabbit.base.graphics.skins.image
Class ImageSkin

java.lang.Object
  extended by org.jrabbit.base.data.cache.CachePointer<Image>
      extended by org.jrabbit.base.graphics.image.ImagePointer
          extended by org.jrabbit.base.graphics.skins.image.ImageSkin
All Implemented Interfaces:
Renderable, Referenced, Retriever<Image>, Skin, Dimensioned
Direct Known Subclasses:
SubImageSkin

public class ImageSkin
extends ImagePointer
implements Skin

An ImageSkin is (obviously) a Skin that renders an Image. All Images it retrieves come from the ImageCache in Resources. ImageSkin extends ImagePointer; thus, it has access to all of the Cache retrieval and optimization of its parent.

Author:
Chris Molini

Field Summary
protected  float height
          The height of the current image.
protected  float width
          The width of the current image.
 
Fields inherited from class org.jrabbit.base.data.cache.CachePointer
object, reference
 
Constructor Summary
ImageSkin(java.lang.String reference)
          Creates an ImageSkin that uses the indicated reference to search for the desired Image in the ImageCache.
 
Method Summary
 float height()
          Learns about the dimensions of the ImageSkin.
 void refresh()
          Refreshes the cached Image reference; this does not need to be called manually unless the contents of the Cache are altered.
 void render()
          Renders the image this ImageSkin represents.
 float width()
          Learns about the dimensions of the ImageSkin.
 
Methods inherited from class org.jrabbit.base.graphics.image.ImagePointer
retrieve
 
Methods inherited from class org.jrabbit.base.data.cache.CachePointer
object, reference, setReference, valid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

protected float width
The width of the current image.


height

protected float height
The height of the current image.

Constructor Detail

ImageSkin

public ImageSkin(java.lang.String reference)
Creates an ImageSkin that uses the indicated reference to search for the desired Image in the ImageCache.

Parameters:
reference - The reference of the Image to search for in the Cache.
Method Detail

render

public void render()
Renders the image this ImageSkin represents.

Specified by:
render in interface Renderable

width

public float width()
Learns about the dimensions of the ImageSkin.

Specified by:
width in interface Dimensioned
Returns:
The width of the Image being rendered.

height

public float height()
Learns about the dimensions of the ImageSkin.

Specified by:
height in interface Dimensioned
Returns:
The height of the Image being rendered.

refresh

public void refresh()
Refreshes the cached Image reference; this does not need to be called manually unless the contents of the Cache are altered. Additionally, this updates the stored dimensional values (width and height).

Overrides:
refresh in class CachePointer<Image>