public class LineSegment extends java.lang.Object
Constructor and Description |
---|
LineSegment(LineSegment ls)
Create a LineSegment object with references to 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(java.awt.Color c)
Give this LineSegment a uniform color.
|
void |
setColorRandom()
Give this LineSegment a uniform, but randomly chosen, color.
|
java.lang.String |
toString()
For debugging.
|
public LineSegment(LineSegment ls)
ls
- LineSegment to make a shallow copy ofpublic LineSegment(Vertex v0, Vertex v1)
v0
- 1st endpoint of te new LineSegmentv1
- 2nd endpoint of the new LineSegmentpublic void setColor(java.awt.Color c)
c
- Color for this LineSegmentpublic void setColorRandom()
public java.lang.String toString()
toString
in class java.lang.Object