nankin.zheng.gatem.view
Class AnchoredImage

java.lang.Object
  |
  +--nankin.zheng.gatem.view.AnchoredImage

public class AnchoredImage
extends java.lang.Object

Anchored Image is an image with an anchor.

If we draw an anchored image with anchor (x,y) at the position (x0,y0) (physical coordonate), that is to say, the pixel (x,y) of the image will be drawn at the position (x0,y0) of the screen. Normally, the anchor is (0,0), indicating that the left-bottom pixel of the image will be drawn at (x0,y0) of the screen.

NOTE that the anchor of the image represents a pixel, therefore is a physical coordonate.

Version:
1.0, Date 2003-04-11
Author:
ZHENG Zhong

Field Summary
private  java.awt.Image image
           
private  int x
           
private  int y
           
 
Constructor Summary
AnchoredImage(java.awt.Image img, int ax, int ay)
          Constructor.
 
Method Summary
 java.awt.Image getImage()
          Get image.
 int getX()
          Get x.
 int getY()
          Get y.
 java.lang.String toString()
          Convert to String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

image

private java.awt.Image image

x

private int x

y

private int y
Constructor Detail

AnchoredImage

public AnchoredImage(java.awt.Image img,
                     int ax,
                     int ay)
Constructor.

Parameters:
img - image
ax - x value of its anchor
ay - y value of its anchor
Throws:
java.lang.NullPointerException - if img is null.
Method Detail

getImage

public java.awt.Image getImage()
Get image.

Returns:
image

getX

public int getX()
Get x.

Returns:
x value of its anchor

getY

public int getY()
Get y.

Returns:
y value of its anchor

toString

public java.lang.String toString()
Convert to String.

Overrides:
toString in class java.lang.Object