jcontrol.graphics
Interface Image

All Superinterfaces:
Drawable
All Known Implementing Classes:
BufferedImage, ResourceImage

public interface Image
extends Drawable

Extended interface for images. In addition to the Drawable's draw methods it defines functions for checking the size of the image and it's validity (availability and correctness of the needed data). Also it features an additional method for drawing with anchor as in the corresponding drawImage method of XGraphics. In high-level programming, this type of objects should be used for all painting of bitmap graphics instead of Resource.


Method Summary
 void draw(XGraphics g, int x, int y, int anchor)
          Draws this image to the given XGraphics object.
 int getHeight()
          Returns the height of the Image in pixels.
 int getWidth()
          Returns the width of the Image in pixels.
 boolean isValid()
          Checks if the Image is properly configured and ready for use.
 
Methods inherited from interface jcontrol.io.Drawable
draw, draw
 

Method Detail

getWidth

int getWidth()
Returns the width of the Image in pixels.

Returns:
image width

getHeight

int getHeight()
Returns the height of the Image in pixels.

Returns:
image height

isValid

boolean isValid()
Checks if the Image is properly configured and ready for use.

Returns:
true, if Image is ready for use

draw

void draw(XGraphics g,
          int x,
          int y,
          int anchor)
Draws this image to the given XGraphics object.

Parameters:
g - XGraphics to draw on
x - x-location
y - y-location
anchor - anchor as defined in XGraphics
See Also:
XGraphics