public class Rectangle2DUtil extends java.lang.Object
Constructor and Description |
---|
Rectangle2DUtil() |
Modifier and Type | Method and Description |
---|---|
static java.awt.geom.Line2D |
getIntersectionLine(java.awt.geom.Rectangle2D rectangle,
java.awt.geom.Line2D line)
Returns the shortest line segment which result from the intersection of the given rectangle bounds and
line.
|
static java.awt.geom.Rectangle2D |
getScaledRectangle(java.awt.geom.Rectangle2D rect,
double factor,
boolean centered)
Returns a scaled form of the specified
Rectangle2D by specified factor. |
static java.awt.geom.Rectangle2D |
getScaledRectangle(java.awt.geom.Rectangle2D rect,
double factor,
boolean centered,
boolean scalePosition)
Returns a scaled form of the specified
Rectangle2D by specified factor. |
public Rectangle2DUtil()
public static java.awt.geom.Line2D getIntersectionLine(java.awt.geom.Rectangle2D rectangle, java.awt.geom.Line2D line)
null
if the line segment does not intersects the Rectangle content.public static java.awt.geom.Rectangle2D getScaledRectangle(java.awt.geom.Rectangle2D rect, double factor, boolean centered, boolean scalePosition)
Rectangle2D
by specified factor.rect
- the Rectangle2D
to scalefactor
- the scale factorcentered
- if true then scaling is centered (rect location is modified)scalePosition
- if true then position is also rescaled (rect location is modified)public static java.awt.geom.Rectangle2D getScaledRectangle(java.awt.geom.Rectangle2D rect, double factor, boolean centered)
Rectangle2D
by specified factor.rect
- the Rectangle2D
to scalefactor
- the scale factorcentered
- if true then scaling is centered (rect location is modified)