com.threerings.opengl.gui.icon
Class ScaledImageIcon

java.lang.Object
  extended by com.threerings.opengl.gui.icon.Icon
      extended by com.threerings.opengl.gui.icon.ScaledImageIcon

public class ScaledImageIcon
extends Icon

Displays a scaled region of an image as an icon.


Field Summary
protected  Image _image
           
protected  Rectangle _sregion
           
protected  int _theight
           
protected  int _twidth
           
 
Constructor Summary
ScaledImageIcon(Image image, int twidth, int theight)
          Creates an icon that will display the specified image scaled to the supplied size.
ScaledImageIcon(Image image, int sx, int sy, int swidth, int sheight, int twidth, int theight)
          Creates an icon that will display the specified region of the supplied image scaled to the supplied size.
 
Method Summary
 int getHeight()
          Returns the height of this icon.
 int getWidth()
          Returns the width of this icon.
 void render(Renderer renderer, int x, int y, float alpha)
          Renders this icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_image

protected Image _image

_sregion

protected Rectangle _sregion

_twidth

protected int _twidth

_theight

protected int _theight
Constructor Detail

ScaledImageIcon

public ScaledImageIcon(Image image,
                       int twidth,
                       int theight)
Creates an icon that will display the specified image scaled to the supplied size.


ScaledImageIcon

public ScaledImageIcon(Image image,
                       int sx,
                       int sy,
                       int swidth,
                       int sheight,
                       int twidth,
                       int theight)
Creates an icon that will display the specified region of the supplied image scaled to the supplied size.

Method Detail

getWidth

public int getWidth()
Description copied from class: Icon
Returns the width of this icon.

Specified by:
getWidth in class Icon

getHeight

public int getHeight()
Description copied from class: Icon
Returns the height of this icon.

Specified by:
getHeight in class Icon

render

public void render(Renderer renderer,
                   int x,
                   int y,
                   float alpha)
Description copied from class: Icon
Renders this icon.

Overrides:
render in class Icon