public class Line extends PolyShape implements Shape
Constructor and Description |
---|
Line()
Make a new orange line with a default size and position.
|
Line(int x1,
int y1,
int x2,
int y2)
Create a new black line between the two given points
|
Line(int x1,
int y1,
int x2,
int y2,
java.awt.Color c)
Create a new line of the given color between the two given
points (lines are never filled, so no filled argument is needed)
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString()
Answer the printed representation of this shape.
|
addTo, currentWindow, getBoundingBox, getCenterX, getCenterY, getColor, getHeight, getWidth, getX, getY, intersects, moveBy, recordWindow, removeFromWindow, setColor
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addTo, currentWindow, getBoundingBox, getCenterX, getCenterY, getColor, getHeight, getWidth, getX, getY, intersects, moveBy, moveTo, paint, recordWindow, removeFromWindow, rotateAround, setColor
public Line()
public Line(int x1, int y1, int x2, int y2)
x1
- the X coordinate of the first pointy1
- the Y coordinate of the first pointx2
- the X coordinate of the second pointy2
- the Y coordinate of the second pointpublic Line(int x1, int y1, int x2, int y2, java.awt.Color c)
x1
- the X coordinate of the first pointy1
- the Y coordinate of the first pointx2
- the X coordinate of the second pointy2
- the Y coordinate of the second point