|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--objectdraw.Drawable | +--objectdraw.Drawable2D | +--objectdraw.Resizable2D | +--objectdraw.VisibleImage
VisibleImage is an implementation of an Image that can be drawn to the screen and has all the characteristics of a Resizable2D object.
Field Summary | |
protected java.awt.Image |
image
The object's image. |
Fields inherited from class objectdraw.Drawable |
canvas, canvasContent, color, DEBUGGING, shown |
Constructor Summary | |
VisibleImage(java.awt.Image image,
double x,
double y,
DrawingCanvas c)
Creates a new VisibleImage object. |
|
VisibleImage(java.awt.Image image,
double x,
double y,
int width,
int height,
DrawingCanvas c)
Creates a new VisibleImage object. |
|
VisibleImage(java.awt.Image image,
Location origin,
DrawingCanvas c)
Creates a new VisibleImage object. |
|
VisibleImage(java.awt.Image image,
Location origin,
int width,
int height,
DrawingCanvas c)
Creates a new VisibleImage object. |
Method Summary | |
void |
draw(java.awt.Graphics g)
Draws the object. |
Bounds |
getBounds()
Retrieves the bounding rectangle of the object. |
double |
getHeight()
Returns the height of the object's bounding rectangle |
double |
getWidth()
Returns the width of the object's bounding rectangle |
void |
loadImage()
Completely loads the image data before it returns. |
void |
move(double dx,
double dy)
Moves the object the specifiec distances in the x and y direction. |
void |
moveTo(double x,
double y)
Moves the object to the specified x and y coordinates. |
void |
moveTo(Location location)
Moves the object to the specified location. |
void |
setBounds(Bounds b)
Set the object's bounding box. |
void |
setHeight(double dist)
Sets the height of the object's bounding rectangle |
void |
setWidth(double dist)
Sets the width of the object's bounding rectangle |
Methods inherited from class objectdraw.Drawable2D |
contains, getLocation, getX, getY, overlaps |
Methods inherited from class objectdraw.Drawable |
addToCanvas, getColor, hide, isHidden, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, setStateChanged, show |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface objectdraw.Drawable2DInterface |
getLocation, getX, getY, overlaps |
Methods inherited from interface objectdraw.DrawableInterface |
addToCanvas, contains, getColor, hide, isHidden, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, show |
Field Detail |
protected java.awt.Image image
Constructor Detail |
public VisibleImage(java.awt.Image image, Location origin, DrawingCanvas c)
image
- the image to displayorigin
- the upper left corner of the bounding rectanglec
- the canvas in which the image is createdpublic VisibleImage(java.awt.Image image, double x, double y, DrawingCanvas c)
image
- the image to displayx
- coordinate of the upper left corner of the bounding rectangley
- coordinate of the upper left corner of the bounding rectanglec
- the canvas in which the image is createdpublic VisibleImage(java.awt.Image image, Location origin, int width, int height, DrawingCanvas c)
image
- the image to displayorigin
- the upper left corner of the bounding rectanglewidth
- the width of the bounding rectangleheight
- the height of the bounding rectanglec
- the canvas in which the image is createdpublic VisibleImage(java.awt.Image image, double x, double y, int width, int height, DrawingCanvas c)
image
- the image to displayx
- coordinate of the upper left corner of the bounding rectangley
- coordinate of the upper left corner of the bounding rectanglewidth
- the width of the bounding rectangleheight
- the height of the bounding rectanglec
- the canvas in which the image is createdMethod Detail |
public void draw(java.awt.Graphics g)
draw
in class Drawable2D
g
- the graphics context into which the object is drawnpublic void moveTo(Location location)
moveTo
in class Resizable2D
location
- the point to which the object is movedpublic void moveTo(double x, double y)
moveTo
in class Drawable
x
- horizontal coordinate of point to which object is movedy
- vertical coordinate of point to which object is movedpublic void move(double dx, double dy)
move
in class Resizable2D
dx
- the amount to move in the x directiondy
- the amount to move in the y directionpublic Bounds getBounds()
public void setBounds(Bounds b)
b
- the bounding rectanglepublic void setWidth(double dist)
dist
- the new widthpublic void setHeight(double dist)
dist
- the new heightpublic double getWidth()
public double getHeight()
getHeight
in class Drawable2D
objectdraw.Drawable2D
public void loadImage()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |