public class LineUtilities extends java.lang.Object
Line2D
objects.Constructor and Description |
---|
LineUtilities() |
Modifier and Type | Method and Description |
---|---|
static boolean |
clipLine(java.awt.geom.Line2D line,
java.awt.geom.Rectangle2D rect)
Clips the specified line to the given rectangle.
|
static java.awt.geom.Line2D |
extendLine(java.awt.geom.Line2D line,
double startPercent,
double endPercent)
Creates a new line by extending an existing line.
|
public LineUtilities()
public static boolean clipLine(java.awt.geom.Line2D line, java.awt.geom.Rectangle2D rect)
line
- the line (null
not permitted).rect
- the clipping rectangle (null
not permitted).true
if the clipped line is visible, and
false
otherwise.public static java.awt.geom.Line2D extendLine(java.awt.geom.Line2D line, double startPercent, double endPercent)
line
- the line (null
not permitted).startPercent
- the amount to extend the line at the start point
end.endPercent
- the amount to extend the line at the end point end.