|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.byu.phun2d.DrawObj edu.byu.phun2d.Line
public class Line
A Line draws a straight line between points (x1,y1) and (x2,y2). The color of the line is determined by setLineColor() and the width of the line is determined by setLineWidth().
Constructor Summary | |
---|---|
Line(double x1,
double y1,
double x2,
double y2)
This will create a new line object that will draw a line between (x1,y1) and (x2,y2). |
Method Summary | |
---|---|
void |
setP1(double x1,
double y1)
This will change the coordinates of the first end point of this line. |
void |
setP2(double x2,
double y2)
This will change the coordinates of the second end point of this line. |
double |
x1()
The X coordinate of the first end point. |
double |
x2()
the X coordinate of the second end point. |
double |
y1()
The Y coordinate of the first end point. |
double |
y2()
The Y coordinate of the second end point. |
Methods inherited from class edu.byu.phun2d.DrawObj |
---|
getFillColor, getLineColor, getLineWidth, getRotate, getScaleX, getScaleY, getTranslate, insideToOutside, outsideToInside, setFillColor, setLineColor, setLineWidth, setRotate, setScale, setTranslate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Line(double x1, double y1, double x2, double y2)
x1
- the X coordinate of the first end point.y1
- the Y coordinate of the first end point.x2
- the X coordinate of the second end point.y2
- the Y coordinate of the second end point.Method Detail |
---|
public void setP1(double x1, double y1)
x1
- the X coordinate of the new first end point.y1
- the Y coordinate of the new first end point.public void setP2(double x2, double y2)
x2
- the X coordinate of the new second end point.y2
- the Y coordinate of the new second end point.public double x1()
public double y1()
public double x2()
public double y2()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |