public class Pen extends Turtle implements PenInterface
Modifier and Type | Field and Description |
---|---|
(package private) int |
col |
(package private) float |
len |
(package private) processing.core.PApplet |
parent |
(package private) float |
width |
VERSION
Constructor and Description |
---|
Pen(processing.core.PApplet parent,
float xpos,
float ypos,
float direction,
float len) |
Pen(processing.core.PApplet parent,
float xpos,
float ypos,
float direction,
float len,
int col) |
Pen(processing.core.PApplet parent,
float xpos,
float ypos,
float direction,
float len,
int col,
float width)
Constructor
|
Pen(Pen pen)
Copy Constructor for pen
|
Modifier and Type | Method and Description |
---|---|
void |
drawLine()
Object orientated way of drawing a line, side effect is to
update the current position
|
int |
getColor()
line color getter
|
float |
getLength()
Line color getter
|
private processing.core.PApplet |
getParent() |
float |
getWidth()
Line width getter
|
void |
incrementGreen(int increment)
With plants in mind using bit shift to increment green
|
void |
resizeLength(float factor)
Facility to change element length
|
void |
setColor(int col)
line color setter
|
void |
setLength(float len)
Length setter
|
void |
setWidth(float width)
Line width setter
|
void |
turnLeft(int repeats)
Evaluate number of repeats and change value of theta
|
void |
turnRight(int repeats)
Evaluate number of repeats and change value of theta
|
clone, getTheta, getX, getY, setTheta, setX, setY
public Pen(Pen pen)
pen
- public Pen(processing.core.PApplet parent, float xpos, float ypos, float direction, float len, int col, float width)
parent
- xpos
- ypos
- direction
- len
- col
- width
- public Pen(processing.core.PApplet parent, float xpos, float ypos, float direction, float len, int col)
parent
- xpos
- ypos
- direction
- len
- col
- public Pen(processing.core.PApplet parent, float xpos, float ypos, float direction, float len)
parent
- xpos
- ypos
- direction
- len
- private processing.core.PApplet getParent()
public float getLength()
getLength
in interface PenInterface
public int getColor()
getColor
in interface PenInterface
public float getWidth()
getWidth
in interface PenInterface
public void setWidth(float width)
setWidth
in interface PenInterface
width
- floatpublic void setColor(int col)
setColor
in interface PenInterface
col
- intpublic void setLength(float len)
setLength
in interface PenInterface
len
- public void resizeLength(float factor)
resizeLength
in interface PenInterface
factor
- public void incrementGreen(int increment)
incrementGreen
in interface PenInterface
increment
- public void turnLeft(int repeats)
turnLeft
in interface PenInterface
repeats
- public void turnRight(int repeats)
turnRight
in interface PenInterface
repeats
- public void drawLine()
drawLine
in interface PenInterface