|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ch.aplu.turtle.TurtleRenderer
This class is responsible for creating and choosing the correct Turtle picture.
Field Summary |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
TurtleRenderer(Turtle turtle)
|
Method Summary | |
java.awt.Image |
currentImage()
Return the current image. |
boolean |
imageChanged(double angle)
Tell whether the image has changed. |
boolean |
imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int width,
int height)
As an image stays unchanged, there's no need to ever update it. |
void |
init(TurtleFactory factory,
int resolution)
Create the images. |
void |
paint(double x,
double y)
This method is responsible for painting the turtle onto the playground at ( x, y ). |
void |
paint(double x,
double y,
java.awt.Graphics g)
This method is responsible for painting the Turtle
at (x, y ). |
void |
paint(java.awt.geom.Point2D.Double p)
This method is responsible for painting the turtle onto the playground at p . |
void |
paint(java.awt.geom.Point2D.Double p,
java.awt.Graphics g)
This method is responsible for painting the Turtle
at p . |
void |
setAngle(double angle)
Set the current image to the one corresponding to the angle angle . |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TurtleRenderer(Turtle turtle)
Method Detail |
public java.awt.Image currentImage()
public boolean imageChanged(double angle)
public boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
java.awt.image.ImageObserver
.
imageUpdate
in interface java.awt.image.ImageObserver
ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
public void init(TurtleFactory factory, int resolution)
resolution
images (i.e. two subsequent
images contain an angle of 2π/
public final void paint(double x, double y)
x, y
).
public final void paint(double x, double y, java.awt.Graphics g)
Turtle
at (x, y
).
public final void paint(java.awt.geom.Point2D.Double p)
p
.
public void paint(java.awt.geom.Point2D.Double p, java.awt.Graphics g)
Turtle
at p
.
public void setAngle(double angle)
angle
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |