public class Line extends Shape
DEFAULT_COLOR
Constructor and Description |
---|
Line(double x1,
double y1,
double x2,
double y2)
Creates a line between the points with the given coordinates.
|
Line(Point p,
Point q)
Creates a line between the given points.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Point p0)
Determines if this line contains the given point.
|
void |
draw(android.graphics.Canvas canvas)
Draws this line on the given canvas.
|
Point |
getCenter()
Returns the center of this line.
|
Point |
getP1()
Returns the first point of this line.
|
Point |
getP2()
Returns the second point of this line.
|
void |
move(double dx,
double dy)
Moves this line by the given displacement.
|
public Line(double x1, double y1, double x2, double 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 boolean contains(Point p0)
public void draw(android.graphics.Canvas canvas)
public Point getCenter()
public Point getP1()
public Point getP2()