|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--background.Background
A "background" is a graphical image. Normally it is placed in the world
(the complete picture) when the world is created, and remains constant.
Every background that is constructed has an x- and y- coordinate,
representing its upperleft-most position in the graphics system,
as well as a width and height representing the maximum horizontal
and vertical distance from the x and y, respectively.
PLEASE NOTE: No error checking is currently done to ensure positive
width and height values.
Field Summary | |
protected java.lang.String |
externalName
Name by which this background icon is known to the world (for example, in a text input file). |
protected double |
height
|
protected double |
width
|
protected double |
xCoor
xCoor and yCoor together represent the TOP-LEFT coordinate of the Background. |
protected double |
yCoor
|
Constructor Summary | |
Background(double x,
double y,
double w,
double h)
Initialize attributes for this Background |
Method Summary | |
abstract void |
draw(java.awt.Graphics2D g)
Use the graphics system to draw the shapes representing this Background |
double |
getHeight()
Returns the height of this Background |
java.lang.String |
getName()
A name by which this background icon is known to the world (for example, in a text file). |
double |
getWidth()
Returns the width of this Background |
double |
getX()
Returns the x position of this Background |
double |
getY()
Returns the y position of this Background |
void |
update(double timeMillies)
Updates the background in some particular way. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected double xCoor
protected double yCoor
protected double width
protected double height
protected java.lang.String externalName
Constructor Detail |
public Background(double x, double y, double w, double h)
x
- x-coordinate of background in the world (leftmost position of background)y
- y-coordinate of background in the world (uppermost position of background)w
- width of the background objecth
- height of the background objectMethod Detail |
public double getX()
public double getY()
public double getWidth()
public double getHeight()
public void update(double timeMillies)
timeMillies
- the delay time in millisecondspublic abstract void draw(java.awt.Graphics2D g)
g
- the graphics system to usepublic java.lang.String getName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |