org.jdrawing.graphics
Class DrawImage

java.lang.Object
  extended byorg.jdrawing.graphics.GraphicsOperation
      extended byorg.jdrawing.graphics.DrawImage
All Implemented Interfaces:
DrawingElement

public class DrawImage
extends GraphicsOperation

Graphics element which corresponds to Graphics.drawImage(Image, int, int, ImageObserver). This element supports asynchronous image loading.


Constructor Summary
DrawImage(java.awt.Image image, int x, int y, java.awt.image.ImageObserver observer)
          Returns Fill with given image at given location.
DrawImage(java.awt.Image image, int x, int y, java.awt.image.ImageObserver observer, Style style)
          Returns Fill with given image at given location.
 
Method Summary
 boolean equals(java.lang.Object object)
          Checks whether two draw image operations are equal.
 java.awt.Image getImage()
          Gets image to be drawn.
 java.awt.image.ImageObserver getObserver()
          Returns the ImageObserver used by this operation.
 java.awt.Shape getShapeOfOperation()
          Returns shape of the area updated by this operation.
 int getX()
          Returns X coordinate of the image.
 int getY()
          Returns X coordinate of the image.
 int hashCode()
          Returns the hashcode for this draw image operation.
 void paintOperation(java.awt.Graphics2D graphics)
          Performs drawing operation.
 void setImage(java.awt.Image image)
          Sets image to be drawn.
 void setObserver(java.awt.image.ImageObserver observer)
          Sets the ImageObserver used by this operation.
 void setX(int x)
          Sets X coordinate of the image.
 void setY(int y)
          Sets Y coordinate of the image.
 
Methods inherited from class org.jdrawing.graphics.GraphicsOperation
contains, getBounds, getBounds2D, getPosition, getStyle, intersects, paint, setPosition, setStyle
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawImage

public DrawImage(java.awt.Image image,
                 int x,
                 int y,
                 java.awt.image.ImageObserver observer)
Returns Fill with given image at given location.

Parameters:
image - the specified image to be drawn
x - the x coordinate
y - the y coordinate

DrawImage

public DrawImage(java.awt.Image image,
                 int x,
                 int y,
                 java.awt.image.ImageObserver observer,
                 Style style)
Returns Fill with given image at given location.

Parameters:
image - the specified image to be drawn
x - the x coordinate
y - the y coordinate
Method Detail

setImage

public void setImage(java.awt.Image image)
Sets image to be drawn.

Parameters:
image - the specified image to be drawn

getImage

public java.awt.Image getImage()
Gets image to be drawn.

Returns:
image to be drawn

setX

public void setX(int x)
Sets X coordinate of the image.

Parameters:
x - the x coordinate

getX

public int getX()
Returns X coordinate of the image.

Returns:
the x coordinate of the image

setY

public void setY(int y)
Sets Y coordinate of the image.

Parameters:
y - the y coordinate

getY

public int getY()
Returns X coordinate of the image.

Returns:
the x coordinate of the image

setObserver

public void setObserver(java.awt.image.ImageObserver observer)
Sets the ImageObserver used by this operation.

Parameters:
observer - an ImageObserver object

getObserver

public java.awt.image.ImageObserver getObserver()
Returns the ImageObserver used by this operation.

Returns:
an ImageObserver object

paintOperation

public void paintOperation(java.awt.Graphics2D graphics)
Performs drawing operation. This implementation invokes graphics.fill ().

Specified by:
paintOperation in class GraphicsOperation
Parameters:
graphics - graphics context to use for painting

getShapeOfOperation

public java.awt.Shape getShapeOfOperation()
Returns shape of the area updated by this operation.

Specified by:
getShapeOfOperation in class GraphicsOperation
Returns:
the shape of updated area

equals

public boolean equals(java.lang.Object object)
Checks whether two draw image operations are equal. The result is true if and only if the argument is not null and is a DrawImage object that has the same attributes as this DrawImage.

Overrides:
equals in class GraphicsOperation
Parameters:
object - the Object to compare with this DrawImage
Returns:
true if the objects are equal; false otherwise.

hashCode

public int hashCode()
Returns the hashcode for this draw image operation.

Overrides:
hashCode in class GraphicsOperation
Returns:
a hash code for this draw image operation.