Class AffineTransform
-
Constructor Summary
ConstructorsConstructorDescriptionCreates identity 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.Creates new affine transform as a copy of the given transform. -
Method Summary
Modifier and TypeMethodDescriptionstatic AffineTransformgetRotateInstance(double theta) Gets a rotation transformstatic AffineTransformgetRotateInstance(double theta, double anchorx, double anchory) Gets a rotation transform.voidSet to the identity matrix.voidsetToRotation(double theta) Sets to a rotation transform.voidsetToRotation(double vecx, double vecy) Sets transform to a rotation transform.voidsetToRotation(double theta, double anchorx, double anchory) Sets to a rotation transform.voidsetToRotation(double vecx, double vecy, double anchorx, double anchory) Sets the transform to a rotation transform.voidsetToScale(double sx, double sy) Sets transform to a scale transform.voidsetToShear(double shx, double shy) Sets transform to a shear transform.voidsetToTranslation(double tx, double ty) Sets transform to a translation transform.voidsetTransform(double m00, double m10, double m01, double m11, double m02, double m12) Sets the transform to the given double coords.toString()Converts the transform to aTransform
-
Constructor Details
-
AffineTransform
public AffineTransform()Creates identity transform. -
AffineTransform
Creates new affine transform as a copy of the given transform.
Parameters
atx: Transform to copy.
-
AffineTransform
public AffineTransform(float m00, float m10, float m01, float m11, float m02, float m12) Creates a new AffineTransform.
Parameters
-
m00: the X coordinate scaling element of the 3x3 matrix -
m10: the Y coordinate shearing element of the 3x3 matrix -
m01: the X coordinate shearing element of the 3x3 matrix -
m11: the Y coordinate scaling element of the 3x3 matrix -
m02: the X coordinate translation element of the 3x3 matrix -
m12: the Y coordinate translation element of the 3x3 matrix
-
-
AffineTransform
public AffineTransform(float[] m) Creates a new AffineTransform.
Parameters
m: @param m the float array containing the values to be set in the newAffineTransformobject. 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.
-
AffineTransform
public AffineTransform(double m00, double m10, double m01, double m11, double m02, double m12) Creates a new AffineTransform.
Parameters
-
m00: the X coordinate scaling element of the 3x3 matrix -
m10: the Y coordinate shearing element of the 3x3 matrix -
m01: the X coordinate shearing element of the 3x3 matrix -
m11: the Y coordinate scaling element of the 3x3 matrix -
m02: the X coordinate translation element of the 3x3 matrix -
m12: the Y coordinate translation element of the 3x3 matrix
-
-
AffineTransform
public AffineTransform(double[] m) Creates a new AffineTransform.
Parameters
m: @param m the double array containing the values to be set in the newAffineTransformobject. 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.
-
-
Method Details
-
getRotateInstance
Gets a rotation transform
Parameters
theta: Radian rotation angle.
-
getRotateInstance
Gets a rotation transform.
Parameters
-
theta: Radian rotation angle. -
anchorx: Anchor point x-coord. -
anchory: Anchor point y-coord.
-
-
setToScale
public void setToScale(double sx, double sy) Sets transform to a scale transform.
Parameters
-
sx: X-scale factor -
sy: Y-scale factor
-
-
setToShear
public void setToShear(double shx, double shy) Sets transform to a shear transform.
Parameters
-
shx: The shear-x -
shy: The shear-y
-
-
setToRotation
public void setToRotation(double vecx, double vecy) Sets transform to a rotation transform.
Parameters
-
vecx: x-coordinate of rotation vector. -
vecy: y-coordinate of rotation vector.
-
-
setToRotation
public void setToRotation(double vecx, double vecy, double anchorx, double anchory) Sets the transform to a rotation transform.
Parameters
-
vecx: x-coordinate of rotation vector. -
vecy: y-coordinate of rotation vector -
anchorx: Anchor point x-coordinate -
anchory: Anchor point y-coordinate
-
-
setToIdentity
public void setToIdentity()Set to the identity matrix. -
setToTranslation
public void setToTranslation(double tx, double ty) Sets transform to a translation transform.
Parameters
-
tx: x-translation -
ty: y-translation
-
-
setToRotation
public void setToRotation(double theta, double anchorx, double anchory) Sets to a rotation transform.
Parameters
-
theta: Radian rotation angle. -
anchorx: Anchor point x-coord. -
anchory: Anchor point y-coord.
-
-
setToRotation
public void setToRotation(double theta) Sets to a rotation transform.
Parameters
theta: Rotation angle in radians.
-
setTransform
public void setTransform(double m00, double m10, double m01, double m11, double m02, double m12) Sets the transform to the given double coords.
Parameters
-
m00: the X coordinate scaling element of the 3x3 matrix -
m10: the Y coordinate shearing element of the 3x3 matrix -
m01: the X coordinate shearing element of the 3x3 matrix -
m11: the Y coordinate scaling element of the 3x3 matrix -
m02: the X coordinate translation element of the 3x3 matrix -
m12: the Y coordinate translation element of the 3x3 matrix
-
-
toTransform
Converts the transform to aTransform -
toString
-