public class RectangularTransform extends Object
AffineTransform, except with no rotation/shearing.
| Constructor and Description |
|---|
RectangularTransform()
Creates an identity transform.
|
RectangularTransform(double sx, double sy, double tx, double ty)
Creates a
RectangularTransform.
|
RectangularTransform(Rectangle2D
Creates a
RectangularTransform that transforms from one rectangle to another.
|
| Modifier and Type | Method and Description |
|---|---|
static AffineTransform |
create(Rectangle2D
Creates an
AffineTransform that maps one argument to another.
|
AffineTransform |
createAffineTransform()
Converts this to an
AffineTransform.
|
RectangularTransform |
createInverse()
Creates a transform that is the inverse of this one.
|
double |
getScaleX()
|
double |
getScaleY()
|
double |
getTranslateX()
|
double |
getTranslateY()
|
void |
scale(double sx, double sy)
Scales this transform.
|
void |
setTransform(Rectangle2D
Defines this transform.
|
Point2D |
transform(Point2D
Transforms the source argument.
|
Rectangle2D |
transform(Rectangle2D
Transforms the source argument.
|
Rectangle2D |
transform(Rectangle2D
Transforms the source argument.
|
void |
translate(double tx, double ty)
Translates this transform.
|
public RectangularTransform()
public RectangularTransform(Rectangle2DoldRect, Rectangle2D newRect)
RectangularTransform that transforms from one rectangle to another.
oldRect - the initial rectangle.
newRect - the final (transformed) rectangle.
public RectangularTransform(double sx,
double sy,
double tx,
double ty)
RectangularTransform.
sx - the scaleX factor
sy - the scaleY factor
tx - the x-translation
ty - the y-translation
public Rectangle2Dtransform(Rectangle2D src)
public Rectangle2Dtransform(Rectangle2D src, Rectangle2D dst)
src - the initial rectangle.
dst - the Rectangle2D to store the results in.
public Point2Dtransform(Point2D src, Point2D dst)
src - the initial point.
dst - the Point2D to store the results in.
public static AffineTransformcreate(Rectangle2D oldRect, Rectangle2D newRect)
AffineTransform that maps one argument to another.
oldRect - the initial rectangle.
newRect - the final (transformed) rectangle.
AffineTransform that maps from the old to the new rectangle.
public void setTransform(Rectangle2DoldRect, Rectangle2D newRect)
oldRect - the initial rect.
newRect - what this transform should turn the initial rectangle into.
public void translate(double tx,
double ty)
tx - the x-translation.
ty - the y-translation.
public double getScaleX()
public double getScaleY()
public double getTranslateX()
public double getTranslateY()
public void scale(double sx,
double sy)
sx - the factor to scale X-values by.
sy - the factor to scale Y-values by.
public AffineTransformcreateAffineTransform()
AffineTransform.
public RectangularTransformcreateInverse()