|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.geom.AffineTransform
, Cloneable

public class AffineTransform

, Serializable

The AffineTransform class represents a 2D affine transform
that performs a linear mapping from 2D coordinates to other 2D
coordinates that preserves the "straightness" and
"parallelness" of lines. Affine transformations can be constructed
using sequences of translations, scales, flips, rotations, and shears.
Such a coordinate transformation can be represented by a 3 row by
3 column matrix with an implied last row of [ 0 0 1 ]. This matrix
transforms source coordinates (x, y) into
destination coordinates (x', y') by considering
them to be a column vector and multiplying the coordinate vector
by the matrix according to the following process:
[ x'] [ m00 m01 m02 ] [ x ] [ m00x + m01y + m02 ]
[ y'] = [ m10 m11 m12 ] [ y ] = [ m10x + m11y + m12 ]
[ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
| Field Summary | |
|---|---|
static int |
TYPE_FLIP
This flag bit indicates that the transform defined by this object performs a mirror image flip about some axis which changes the normally right handed coordinate system into a left handed system in addition to the conversions indicated by other flag bits. |
static int |
TYPE_GENERAL_ROTATION
This flag bit indicates that the transform defined by this object performs a rotation by an arbitrary angle in addition to the conversions indicated by other flag bits. |
static int |
TYPE_GENERAL_SCALE
This flag bit indicates that the transform defined by this object performs a general scale in addition to the conversions indicated by other flag bits. |
static int |
TYPE_GENERAL_TRANSFORM
This constant indicates that the transform defined by this object performs an arbitrary conversion of the input coordinates. |
static int |
TYPE_IDENTITY
This constant indicates that the transform defined by this object is an identity transform. |
static int |
TYPE_MASK_ROTATION
This constant is a bit mask for any of the rotation flag bits. |
static int |
TYPE_MASK_SCALE
This constant is a bit mask for any of the scale flag bits. |
static int |
TYPE_QUADRANT_ROTATION
This flag bit indicates that the transform defined by this object performs a quadrant rotation by some multiple of 90 degrees in addition to the conversions indicated by other flag bits. |
static int |
TYPE_TRANSLATION
This flag bit indicates that the transform defined by this object performs a translation in addition to the conversions indicated by other flag bits. |
static int |
TYPE_UNIFORM_SCALE
This flag bit indicates that the transform defined by this object performs a uniform scale in addition to the conversions indicated by other flag bits. |
| Constructor Summary | |
|---|---|
AffineTransform
Constructs a new AffineTransform representing the
Identity transformation. |
|
AffineTransform
Constructs a new AffineTransform that is a copy of
the specified AffineTransform object. |
|
AffineTransform
Constructs a new AffineTransform from an array of
double precision values representing either the 4 non-translation
entries or the 6 specifiable entries of the 3x3 transformation
matrix. |
|
AffineTransform
Constructs a new AffineTransform from 6 double
precision values representing the 6 specifiable entries of the 3x3
transformation matrix. |
|
AffineTransform
Constructs a new AffineTransform from an array of
floating point values representing either the 4 non-translation
enries or the 6 specifiable entries of the 3x3 transformation
matrix. |
|
AffineTransform
Constructs a new AffineTransform from 6 floating point
values representing the 6 specifiable entries of the 3x3
transformation matrix. |
|
| Method Summary | |
|---|---|
Object |
clone
Returns a copy of this AffineTransform object. |
void |
concatenate
Concatenates an AffineTransform Tx to
this AffineTransform Cx in the most commonly useful
way to provide a new user space
that is mapped to the former user space by Tx. |
AffineTransform |
createInverse
Returns an AffineTransform object representing the
inverse transformation. |
Shape |
createTransformedShape
Returns a new Shape object defined by the geometry of the
specified Shape after it has been transformed by
this transform. |
void |
deltaTransform
Transforms an array of relative distance vectors by this transform. |
Point2D |
deltaTransform
Transforms the relative distance vector specified by ptSrc and stores the result in ptDst. |
boolean |
equals
Returns true if this AffineTransform
represents the same affine coordinate transform as the specified
argument. |
double |
getDeterminant
Returns the determinant of the matrix representation of the transform. |
void |
getMatrix
Retrieves the 6 specifiable values in the 3x3 affine transformation matrix and places them into an array of double precisions values. |
static AffineTransform |
getRotateInstance
Returns a transform representing a rotation transformation. |
static AffineTransform |
getRotateInstance
Returns a transform that rotates coordinates around an anchor point. |
static AffineTransform |
getScaleInstance
Returns a transform representing a scaling transformation. |
double |
getScaleX
Returns the X coordinate scaling element (m00) of the 3x3 affine transformation matrix. |
double |
getScaleY
Returns the Y coordinate scaling element (m11) of the 3x3 affine transformation matrix. |
static AffineTransform |
getShearInstance
Returns a transform representing a shearing transformation. |
double |
getShearX
Returns the X coordinate shearing element (m01) of the 3x3 affine transformation matrix. |
double |
getShearY
Returns the Y coordinate shearing element (m10) of the 3x3 affine transformation matrix. |
static AffineTransform |
getTranslateInstance
Returns a transform representing a translation transformation. |
double |
getTranslateX
Returns the X coordinate of the translation element (m02) of the 3x3 affine transformation matrix. |
double |
getTranslateY
Returns the Y coordinate of the translation element (m12) of the 3x3 affine transformation matrix. |
int |
getType
Retrieves the flag bits describing the conversion properties of this transform. |
int |
hashCode
Returns the hashcode for this transform. |
void |
inverseTransform
Inverse transforms an array of double precision coordinates by this transform. |
Point2D |
inverseTransform
Inverse transforms the specified ptSrc and stores the
result in ptDst. |
boolean |
isIdentity
Returns true if this AffineTransform is
an identity transform. |
void |
preConcatenate
Concatenates an AffineTransform Tx to
this AffineTransform Cx
in a less commonly used way such that Tx modifies the
coordinate transformation relative to the absolute pixel
space rather than relative to the existing user space. |
void |
rotate
Concatenates this transform with a rotation transformation. |
void |
rotate
Concatenates this transform with a transform that rotates coordinates around an anchor point. |
void |
scale
Concatenates this transform with a scaling transformation. |
void |
setToIdentity
Resets this transform to the Identity transform. |
void |
setToRotation
Sets this transform to a rotation transformation. |
void |
setToRotation
Sets this transform to a translated rotation transformation. |
void |
setToScale
Sets this transform to a scaling transformation. |
void |
setToShear
Sets this transform to a shearing transformation. |
void |
setToTranslation
Sets this transform to a translation transformation. |
void |
setTransform
Sets this transform to a copy of the transform in the specified AffineTransform object. |
void |
setTransform
Sets this transform to the matrix specified by the 6 double precision values. |
void |
shear
Concatenates this transform with a shearing transformation. |
String |
toString
Returns a String that represents the value of this
Object . |
void |
transform
Transforms an array of double precision coordinates by this transform. |
void |
transform
Transforms an array of double precision coordinates by this transform and stores the results into an array of floats. |
void |
transform
Transforms an array of floating point coordinates by this transform and stores the results into an array of doubles. |
void |
transform
Transforms an array of floating point coordinates by this transform. |
void |
transform
Transforms an array of point objects by this transform. |
Point2D |
transform
Transforms the specified ptSrc and stores the result
in ptDst. |
void |
translate
Concatenates this transform with a translation transformation. |
Methods inherited from class java.lang.Object ![]() |
|---|
finalize |
| Field Detail |
|---|

public static final int TYPE_IDENTITY
TYPE_TRANSLATION
,
TYPE_UNIFORM_SCALE
,
TYPE_GENERAL_SCALE
,
TYPE_FLIP
,
TYPE_QUADRANT_ROTATION
,
TYPE_GENERAL_ROTATION
,
TYPE_GENERAL_TRANSFORM
,
getType()
,
Constant Field Values

public static final int TYPE_TRANSLATION
TYPE_IDENTITY
,
TYPE_UNIFORM_SCALE
,
TYPE_GENERAL_SCALE
,
TYPE_FLIP
,
TYPE_QUADRANT_ROTATION
,
TYPE_GENERAL_ROTATION
,
TYPE_GENERAL_TRANSFORM
,
getType()
,
Constant Field Values

public static final int TYPE_UNIFORM_SCALE
TYPE_IDENTITY
,
TYPE_TRANSLATION
,
TYPE_GENERAL_SCALE
,
TYPE_FLIP
,
TYPE_QUADRANT_ROTATION
,
TYPE_GENERAL_ROTATION
,
TYPE_GENERAL_TRANSFORM
,
getType()
,
Constant Field Values

public static final int TYPE_GENERAL_SCALE
TYPE_IDENTITY
,
TYPE_TRANSLATION
,
TYPE_UNIFORM_SCALE
,
TYPE_FLIP
,