|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Canvas
|
+--DrawableSurface.DrawableSurface
This is the base class. We can draw an animated Image on it.
| Field Summary | |
protected AnimatedImage |
animatedImage
This is the animated image of the surface. |
protected int |
height
The height of the animatedimage |
protected boolean |
painted
This is the boolean preventing from the nullpointer exception |
protected int |
width
The width of the animatedImage |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
| Constructor Summary | |
DrawableSurface(int width,
int height)
The second constructor. |
|
DrawableSurface(int width,
int height,
Color backgroundColor)
The constructor. |
|
| Method Summary | |
AnimatedImage |
animatedImage()
This method returns the animated image of our drawable surface. |
void |
eraseSurface(Color color)
This method erase the drawable surface whith the color defined in parameter. |
int |
height()
This method returns the height of our drawable surface. |
void |
paint(Graphics g)
The paint method. |
void |
start()
Method which set the boolean to true. |
void |
update(Graphics g)
The update method. |
int |
width()
This method returns the width of our drawable surface. |
| Methods inherited from class java.awt.Canvas |
addNotify |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected AnimatedImage animatedImage
protected boolean painted
protected int width
protected int height
| Constructor Detail |
public DrawableSurface(int width,
int height,
Color backgroundColor)
width - The width of our drawable surface.height - The height of our drawable surface.backgroundColor - The background color of our drawable surface.
public DrawableSurface(int width,
int height)
width - The width of our drawable surface.height - The height of our drawable surface.| Method Detail |
public void start()
public void paint(Graphics g)
g - The graphics context.public void update(Graphics g)
public void eraseSurface(Color color)
color - The new backgroundColor.public int width()
public int height()
public AnimatedImage animatedImage()
AnimatedImage
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||