net.sf.freecol.common.resources
Class ImageResource

java.lang.Object
  extended by net.sf.freecol.common.resources.Resource
      extended by net.sf.freecol.common.resources.ImageResource

public class ImageResource
extends Resource

A Resource wrapping an Image.

See Also:
Resource

Method Summary
 java.awt.Image getGrayscaleImage(java.awt.Dimension d)
          Gets a grayscale version of the image of the given size.
 java.awt.Image getGrayscaleImage(double scale)
          Returns the image using the specified scale.
 java.awt.Image getImage()
          Gets the Image represented by this resource.
 java.awt.Image getImage(java.awt.Dimension d)
          Returns the image using the specified dimension.
 java.awt.Image getImage(double scale)
          Returns the image using the specified scale.
 
Methods inherited from class net.sf.freecol.common.resources.Resource
getResourceLocator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getImage

public java.awt.Image getImage()
Gets the Image represented by this resource.

Returns:
The image in it's original size.

getImage

public java.awt.Image getImage(double scale)
Returns the image using the specified scale.

Parameters:
scale - The size of the requested image (with 1 being normal size, 2 twice the size, 0.5 half the size etc). Rescaling will be performed unless using 1.
Returns:
The Image.

getImage

public java.awt.Image getImage(java.awt.Dimension d)
Returns the image using the specified dimension.

Parameters:
d - The dimension of the requested image. Rescaling will be performed if necessary.
Returns:
The Image.

getGrayscaleImage

public java.awt.Image getGrayscaleImage(java.awt.Dimension d)
Gets a grayscale version of the image of the given size.

Parameters:
d - The requested size.
Returns:
The Image.

getGrayscaleImage

public java.awt.Image getGrayscaleImage(double scale)
Returns the image using the specified scale.

Parameters:
scale - The size of the requested image (with 1 being normal size, 2 twice the size, 0.5 half the size etc). Rescaling will be performed unless using 1.
Returns:
The Image.