de.matthiasmann.twl.theme
Class EmptyImage

java.lang.Object
  extended by de.matthiasmann.twl.theme.EmptyImage
All Implemented Interfaces:
Image

public class EmptyImage
extends java.lang.Object
implements Image

An empty image does not draw anything but has a size.


Constructor Summary
EmptyImage(int width, int height)
           
 
Method Summary
 Image createTintedVersion(Color color)
          Creates a new image with is tinted with the specified color.
 void draw(AnimationState as, int x, int y)
          Draws the image in it's original size at the given location
 void draw(AnimationState as, int x, int y, int width, int height)
          Draws the image scaled to the given size at the given location
 int getHeight()
          Returns the height in pixels of the image
 int getWidth()
          Returns the width in pixels of the image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmptyImage

public EmptyImage(int width,
                  int height)
Method Detail

draw

public void draw(AnimationState as,
                 int x,
                 int y)
Description copied from interface: Image
Draws the image in it's original size at the given location

Specified by:
draw in interface Image
Parameters:
as - A time source for animation - may be null
x - left coordinate
y - top coordinate

draw

public void draw(AnimationState as,
                 int x,
                 int y,
                 int width,
                 int height)
Description copied from interface: Image
Draws the image scaled to the given size at the given location

Specified by:
draw in interface Image
Parameters:
as - A time source for animation - may be null
x - left coordinate
y - top coordinate
width - the width in pixels
height - the height in pixels

getWidth

public int getWidth()
Description copied from interface: Image
Returns the width in pixels of the image

Specified by:
getWidth in interface Image
Returns:
the width in pixels of the image

getHeight

public int getHeight()
Description copied from interface: Image
Returns the height in pixels of the image

Specified by:
getHeight in interface Image
Returns:
the height in pixels of the image

createTintedVersion

public Image createTintedVersion(Color color)
Description copied from interface: Image
Creates a new image with is tinted with the specified color. Tinting works by multiplying the color of the image's pixels with the specified color.

Specified by:
createTintedVersion in interface Image
Parameters:
color - The color used for tinting.
Returns:
a new Image object.