|
|||||||||
| 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 |
| Method Summary | |
protected Point2D.Double |
calcTopLeftCorner(double x,
double y)
Compute the top left corner of the Turtle image (dependent on the specified x- and y-coordinate and the image width and height. |
protected Point2D.Double |
calcTopLeftCorner(Point2D.Double p)
Compute the top left corner of the Turtle image (dependent on the specified point p and the image
width and height. |
protected int |
calcTopLeftCornerX(double x)
Compute the x-coordinate of the top left corner of the Turtle image (it depends on the specified x-coordinate and the image width). |
protected int |
calcTopLeftCornerY(double y)
Compute the y-coordinate of the top left corner of the Turtle image (it depends on the specified y-coordinate and the image height). |
protected void |
clipPaint(int x,
int y,
Graphics graphics)
Defines how to paint in clip mode (and does it!) |
Image |
currentImage()
Returns the current image. |
protected double |
getAngle()
|
boolean |
imageChanged(double angle)
Tells whether the image has changed. |
boolean |
imageUpdate(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)
Creates the images. |
protected void |
internalPaint(double x,
double y,
Graphics graphics)
Calls clipPaint and WrapPaint(). |
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,
Graphics graphics)
This method is responsible for painting the Turtle
at (x, y). |
void |
paint(Point2D.Double p)
This method is responsible for painting the turtle onto the playground at p. |
void |
paint(Point2D.Double p,
Graphics graphics)
This method is responsible for painting the Turtle
at p. |
void |
setAngle(double angle)
Sets the current image to the one corresponding to the angle angle. |
protected void |
wrapPaint(int x,
int y,
Graphics graphics)
Defines how to paint in wrap mode (and does it!) |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public boolean imageUpdate(Image img,
int infoflags,
int x,
int y,
int width,
int height)
java.awt.image.ImageObserver.
imageUpdate in interface ImageObserverImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)public Image currentImage()
public boolean imageChanged(double angle)
public void setAngle(double angle)
angle.
protected double getAngle()
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(Point2D.Double p)
p.
public final void paint(double x,
double y,
Graphics graphics)
Turtle
at (x, y).
public void paint(Point2D.Double p,
Graphics graphics)
Turtle
at p.
protected void internalPaint(double x,
double y,
Graphics graphics)
clipPaint(int, int, Graphics),
wrapPaint(int, int, Graphics)
protected void clipPaint(int x,
int y,
Graphics graphics)
protected void wrapPaint(int x,
int y,
Graphics graphics)
protected int calcTopLeftCornerX(double x)
protected int calcTopLeftCornerY(double y)
protected Point2D.Double calcTopLeftCorner(double x,
double y)
protected Point2D.Double calcTopLeftCorner(Point2D.Double p)
p and the image
width and height.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||