public class LineSegment extends Object
Vertex
objects
that represent the endpoints of the line segment.Constructor and Description |
---|
LineSegment(LineSegment ls)
Create a LineSegment object with references to copies of the two
Vertex objects in the given LineSegment object. |
LineSegment(Vertex v0,
Vertex v1)
Create a LineSegment object with references to the
two given
Vertex objects. |
Modifier and Type | Method and Description |
---|---|
void |
setColor(Color c)
Give this LineSegment a uniform color.
|
void |
setColorRandom()
Give this LineSegment a uniform, but randomly chosen, color.
|
String |
toString()
For debugging.
|
public LineSegment(LineSegment ls)
Vertex
objects in the given LineSegment object.
Notice that this is a "deep copy" of the given LineSegment object.
ls
- LineSegment to make a deep copy ofpublic LineSegment(Vertex v0, Vertex v1)
Vertex
objects.v0
- 1st endpoint of the new LineSegmentv1
- 2nd endpoint of the new LineSegmentpublic void setColor(Color c)
c
- Color for this LineSegmentpublic void setColorRandom()