|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectslogo.gui.PenLine
public class PenLine
A class representation of the line being drawn by the turtle, allows us to store some extra info, e.g. Color
Field Summary | |
---|---|
private java.awt.geom.Point2D |
endP
|
private java.awt.Color |
myColor
|
private java.awt.geom.Line2D |
myLine
|
private java.awt.geom.Point2D |
startP
|
Constructor Summary | |
---|---|
PenLine(java.awt.geom.Point2D start,
java.awt.geom.Point2D end,
java.awt.Color c)
|
Method Summary | |
---|---|
void |
draw(java.awt.Graphics g)
Draws the line from start point to end point in the line's color |
java.awt.Color |
getColor()
Gets the line's color |
java.awt.geom.Point2D |
getEndPoint()
Gets the end point of the line |
java.awt.geom.Point2D |
getStartPoint()
Gets the start point for the line |
void |
setColor(java.awt.Color c)
Set the color for the line |
void |
setEndPoint(java.awt.geom.Point2D p)
Set end point for the line |
void |
setStartPoint(java.awt.geom.Point2D p)
Set start point for the line |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.awt.geom.Line2D myLine
private java.awt.geom.Point2D startP
private java.awt.geom.Point2D endP
private java.awt.Color myColor
Constructor Detail |
---|
public PenLine(java.awt.geom.Point2D start, java.awt.geom.Point2D end, java.awt.Color c)
Method Detail |
---|
public void draw(java.awt.Graphics g)
g
- graphics that draw the pointpublic java.awt.geom.Point2D getStartPoint()
public java.awt.geom.Point2D getEndPoint()
public java.awt.Color getColor()
public void setColor(java.awt.Color c)
c
- is the color the line will be drawn aspublic void setStartPoint(java.awt.geom.Point2D p)
p
- is the coordinate point for the line's start pointpublic void setEndPoint(java.awt.geom.Point2D p)
p
- is the coordinate point for the line's end point
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |