java.lang.Objectobjectdraw.ObjectDrawObject
objectdraw.ObjectDrawShape
objectdraw.Line
objectdraw.AngLine
public class AngLine
The AngLine
class provides a different way to make lines: instead of specifying
start and end points, you make an AngLine
by providing a start point, the length
of the line, and the direction (as an angle in radians) that the line should extend from the
start point.
Field Summary |
---|
Fields inherited from interface objectdraw.DrawableStrokeInterface |
---|
CLICK_SIZE, DEFAULT_STROKE |
Constructor Summary | |
---|---|
AngLine(double x,
double y,
double length,
double radianAngle,
Color color,
DrawingCanvas canvas)
Create a line of the specified color starting at (x , y ) and
extending a distance length from there at an angle radianAngle . |
|
AngLine(double x,
double y,
double length,
double radianAngle,
DrawingCanvas canvas)
Create a black line starting at ( x , y ) and
extending a distance length from there at an angle radianAngle . |
|
AngLine(Location start,
double length,
double radianAngle,
Color color,
DrawingCanvas canvas)
Create a line of the specified color starting at start and
extending a distance length from there at an angle radianAngle . |
|
AngLine(Location start,
double length,
double radianAngle,
DrawingCanvas canvas)
Create a black line starting at start and
extending a distance length from there at an angle radianAngle . |
Method Summary |
---|
Methods inherited from class objectdraw.Line |
---|
addToCanvas, contains, getCanvas, getColor, getEnd, getLineWidth, getStart, getStroke, hide, isHidden, move, moveTo, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, setEnd, setEnd, setEndPoints, setEndPoints, setLineWidth, setStart, setStart, setStroke, show, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AngLine(double x, double y, double length, double radianAngle, Color color, DrawingCanvas canvas)
color
starting at (x
, y
) and
extending a distance length
from there at an angle radianAngle
.
x
- x coordinate of the start locationy
- y coordinate of the start locationlength
- Length of the lineradianAngle
- Angular direction of the line, in radians. 0 is east,
Math.PI / 2
is north, and so on, as is customary in math.color
- Color
of the linecanvas
- DrawingCanvas
to add this line topublic AngLine(double x, double y, double length, double radianAngle, DrawingCanvas canvas)
x
, y
) and
extending a distance length
from there at an angle radianAngle
.
x
- x coordinate of the start locationy
- y coordinate of the start locationlength
- Length of the lineradianAngle
- Angular direction of the line, in radians. 0 is east,
Math.PI / 2
is north, and so on, as is customary in math.canvas
- DrawingCanvas
to add this line topublic AngLine(Location start, double length, double radianAngle, Color color, DrawingCanvas canvas)
color
starting at start
and
extending a distance length
from there at an angle radianAngle
.
start
- Location
of the start point of the linelength
- Length of the lineradianAngle
- Angular direction of the line, in radians. 0 is east,
Math.PI / 2
is north, and so on, as is customary in math.color
- Color
of the linecanvas
- DrawingCanvas
to add this line topublic AngLine(Location start, double length, double radianAngle, DrawingCanvas canvas)
start
and
extending a distance length
from there at an angle radianAngle
.
start
- Location
of the start point of the linelength
- Length of the lineradianAngle
- Angular direction of the line, in radians. 0 is east,
Math.PI / 2
is north, and so on, as is customary in math.canvas
- DrawingCanvas
to add this line to