ch.aplu.turtle
Class LineRenderer

java.lang.Object
  |
  +--ch.aplu.turtle.LineRenderer

public class LineRenderer
extends Object

This class is responsible for drawing the turtle's lines.

Version:
0.1
Author:
Regula Hoefer-Isenegger

Method Summary
protected  void clipLineTo(double x, double y)
          Does the actual painting for clip mode.
 void init(double x, double y)
          Initialisation with coordinates x and y.
 void init(Point2D.Double p)
          Same as init(double x, double y), but with a Point2D.Double argument for convenience
protected  void internalLineTo(double x, double y)
          Calls the clipLineTo and wrapLineTo methods, according to the turtle's edge behavior.
 void lineTo(double x, double y)
          Calls the internalLineTo(x,y), which does the actual painting.
 void lineTo(Point2D.Double p)
          Calls the internalLineTo(x,y), which does the actual painting.
protected  void wrapLineTo(double x, double y)
          Does the actual painting for wrap mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public void init(double x,
                 double y)
Initialisation with coordinates x and y.


init

public void init(Point2D.Double p)
Same as init(double x, double y), but with a Point2D.Double argument for convenience


internalLineTo

protected void internalLineTo(double x,
                              double y)
Calls the clipLineTo and wrapLineTo methods, according to the turtle's edge behavior. Only overwrite this method when working with another (one that you have defined) edge behaviour.
If you mean to change the manner of drawing lines, do this in the methods clipLineTo() and wrapLineTo().

See Also:
clipLineTo(double, double), wrapLineTo(double, double)

lineTo

public void lineTo(double x,
                   double y)
Calls the internalLineTo(x,y), which does the actual painting.


lineTo

public void lineTo(Point2D.Double p)
Calls the internalLineTo(x,y), which does the actual painting. This method works the same way as lineTo(double x, double y), but is added for convenience.


clipLineTo

protected void clipLineTo(double x,
                          double y)
Does the actual painting for clip mode. It works already with ScreenCoords! For further comments cf. internalLineTo(double x, double y).

See Also:
internalLineTo(double, double)

wrapLineTo

protected void wrapLineTo(double x,
                          double y)
Does the actual painting for wrap mode. It works already with ScreenCoords! For further comments cf. internalLineTo(double x, double y).

See Also:
internalLineTo(double, double)