public class AffineTransform extends Object
Constructor and Description |
---|
AffineTransform()
Creates identity transform.
|
AffineTransform(AffineTransform Tx)
Creates new affine transform as a copy of the given transform.
|
AffineTransform(double[] m)
Creates a new AffineTransform.
|
AffineTransform(double m00,
double m10,
double m01,
double m11,
double m02,
double m12)
Creates a new AffineTransform.
|
AffineTransform(float[] m)
Creates a new AffineTransform.
|
AffineTransform(float m00,
float m10,
float m01,
float m11,
float m02,
float m12)
Creates a new AffineTransform.
|
Modifier and Type | Method and Description |
---|---|
static AffineTransform |
getRotateInstance(double theta)
Gets a rotation transform
|
static AffineTransform |
getRotateInstance(double theta,
double anchorx,
double anchory)
Gets a rotation transform.
|
void |
setToIdentity()
Set to the identity matrix.
|
void |
setToRotation(double theta)
Sets to a rotation transform.
|
void |
setToRotation(double vecx,
double vecy)
Sets transform to a rotation transform.
|
void |
setToRotation(double theta,
double anchorx,
double anchory)
Sets to a rotation transform.
|
void |
setToRotation(double vecx,
double vecy,
double anchorx,
double anchory)
Sets the transform to a rotation transform.
|
void |
setToScale(double sx,
double sy)
Sets transform to a scale transform.
|
void |
setToShear(double shx,
double shy)
Sets transform to a shear transform.
|
void |
setToTranslation(double tx,
double ty)
Sets transform to a translation transform.
|
void |
setTransform(double m00,
double m10,
double m01,
double m11,
double m02,
double m12)
Sets the transform to the given double coords.
|
String |
toString()
Returns a string representation of the object.
|
Transform |
toTransform()
Converts the transform to a
Transform |
public AffineTransform()
public AffineTransform(AffineTransform Tx)
Tx
- Transform to copy.public AffineTransform(float m00, float m10, float m01, float m11, float m02, float m12)
m00
- the X coordinate scaling element of the 3x3 matrixm10
- the Y coordinate shearing element of the 3x3 matrixm01
- the X coordinate shearing element of the 3x3 matrixm11
- the Y coordinate scaling element of the 3x3 matrixm02
- the X coordinate translation element of the 3x3 matrixm12
- the Y coordinate translation element of the 3x3 matrixpublic AffineTransform(float[] m)
m
- the float array containing the values to be set
in the new AffineTransform
object. The length of the
array is assumed to be at least 4. If the length of the array is
less than 6, only the first 4 values are taken. If the length of
the array is greater than 6, the first 6 values are taken.public AffineTransform(double m00, double m10, double m01, double m11, double m02, double m12)
m00
- the X coordinate scaling element of the 3x3 matrixm10
- the Y coordinate shearing element of the 3x3 matrixm01
- the X coordinate shearing element of the 3x3 matrixm11
- the Y coordinate scaling element of the 3x3 matrixm02
- the X coordinate translation element of the 3x3 matrixm12
- the Y coordinate translation element of the 3x3 matrixpublic AffineTransform(double[] m)
m
- the double array containing the values to be set
in the new AffineTransform
object. The length of the
array is assumed to be at least 4. If the length of the array is
less than 6, only the first 4 values are taken. If the length of
the array is greater than 6, the first 6 values are taken.public void setToScale(double sx, double sy)
sx
- X-scale factorsy
- Y-scale factorpublic void setToShear(double shx, double shy)
shx
- The shear-xshy
- The shear-ypublic void setToRotation(double vecx, double vecy)
vecx
- x-coordinate of rotation vector.vecy
- y-coordinate of rotation vector.public void setToRotation(double vecx, double vecy, double anchorx, double anchory)
vecx
- x-coordinate of rotation vector.vecy
- y-coordinate of rotation vectoranchorx
- Anchor point x-coordinateanchory
- Anchor point y-coordinatepublic void setToIdentity()
public void setToTranslation(double tx, double ty)
tx
- x-translationty
- y-translationpublic static AffineTransform getRotateInstance(double theta)
theta
- Radian rotation angle.public static AffineTransform getRotateInstance(double theta, double anchorx, double anchory)
theta
- Radian rotation angle.anchorx
- Anchor point x-coord.anchory
- Anchor point y-coord.public void setToRotation(double theta, double anchorx, double anchory)
theta
- Radian rotation angle.anchorx
- Anchor point x-coord.anchory
- Anchor point y-coord.public void setToRotation(double theta)
theta
- Rotation angle in radians.public void setTransform(double m00, double m10, double m01, double m11, double m02, double m12)
m00
- the X coordinate scaling element of the 3x3 matrixm10
- the Y coordinate shearing element of the 3x3 matrixm01
- the X coordinate shearing element of the 3x3 matrixm11
- the Y coordinate scaling element of the 3x3 matrixm02
- the X coordinate translation element of the 3x3 matrixm12
- the Y coordinate translation element of the 3x3 matrixpublic String toString()
Object