java.lang.Objectcomputational.geometry.Ray
computational.geometry.HorizontalRay
public class HorizontalRay
| Field Summary |
|---|
| Fields inherited from class computational.geometry.Ray |
|---|
direction, label, origin |
| Constructor Summary | |
|---|---|
HorizontalRay(int x0,
int y0)
|
|
HorizontalRay(Point origin)
|
|
HorizontalRay(java.lang.String label,
int x0,
int y0)
|
|
HorizontalRay(java.lang.String label,
Point origin)
CONSTRUCTORS |
|
| Method Summary | |
|---|---|
boolean |
contains(Point p)
Tells whether the shape encloses a given point. |
void |
draw(java.awt.Graphics gfx)
Draws the shape, using the current graphics context's color. |
void |
drawLabels(java.awt.Graphics gfx)
Draws the shape's associated labels, using the graphics context's color. |
void |
drawPoints(java.awt.Graphics gfx)
Draws the shape's defining points, using the graphics context's color. |
java.util.List |
getPoints()
Shape Implementation |
int |
intersect(Segment s)
|
| Methods inherited from class computational.geometry.Ray |
|---|
boundingBox, clone, cross, crossLine, getDirection, getLabel, getOrigin, setDirection, setLabel, toString, translate |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface computational.geometry.Shape |
|---|
getLabel, setLabel, translate |
| Constructor Detail |
|---|
public HorizontalRay(int x0,
int y0)
public HorizontalRay(Point origin)
public HorizontalRay(java.lang.String label,
int x0,
int y0)
public HorizontalRay(java.lang.String label,
Point origin)
| Method Detail |
|---|
public boolean contains(Point p)
Shape
contains in interface Shapecontains in class Rayp - the point we test for encloseness.
public void draw(java.awt.Graphics gfx)
Shape
draw in interface Shapedraw in class Raygfx - the graphics context where this shape has to be drawn.public void drawLabels(java.awt.Graphics gfx)
Shape
drawLabels in interface ShapedrawLabels in class Raygfx - the graphics context where this shape's labels have
to be drawn.public void drawPoints(java.awt.Graphics gfx)
Shape
drawPoints in interface ShapedrawPoints in class Raygfx - the graphics context where this shape's points have
to be drawn.public java.util.List getPoints()
getPoints in interface ShapegetPoints in class Raypublic int intersect(Segment s)