Class AffineTransform2D
- Object
- 
- AffineTransform
- 
- AffineTransform2D
 
 
- 
- All Implemented Interfaces:
- Serializable,- Cloneable,- Matrix,- Cloneable
 
 public class AffineTransform2D extends AffineTransform implements Matrix An affine matrix of fixed 3×3 size. Here, the term "affine" means a matrix with the last row fixed to[0,0,1]values. Such matrices are used for affine transformations in a 2D space.This class both extends the Java2D AffineTransformclass and implements theMatrixinterface. It allows interoperbility for code that need to pass the same matrix to both Java2D API and more generic API working with coordinates of arbitrary dimension.This class do not implements the XMatrixinterface because the inheritedinvert()method (new in J2SE 1.6) declares a checked exception,setZero()would be an unsupported operation (because it is not possible to change the value at(2,2)),transpose()would fails in most cases, andisAffine()would be useless.- Since:
- 2.3
- Author:
- Martin Desruisseaux (IRD)
- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intSIZEThe matrix size, which is 3.- 
Fields inherited from class AffineTransformTYPE_FLIP, TYPE_GENERAL_ROTATION, TYPE_GENERAL_SCALE, TYPE_GENERAL_TRANSFORM, TYPE_IDENTITY, TYPE_MASK_ROTATION, TYPE_MASK_SCALE, TYPE_QUADRANT_ROTATION, TYPE_TRANSLATION, TYPE_UNIFORM_SCALE
 
- 
 - 
Constructor SummaryConstructors Constructor Description AffineTransform2D()Creates a new identity matrix.AffineTransform2D(AffineTransform transform)Constructs a 3×3 matrix from the specified affine transform.AffineTransform2D(Matrix matrix)Creates a new matrix initialized to the same value than the specified one.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description AffineTransform2Dclone()Returns a clone of this affine transform.booleanequals(Object obj)doublegetElement(int row, int column)Retrieves the value at the specified row and column of this matrix.intgetNumCol()Returns the number of colmuns in this matrix, which is always 3 in this implementation.intgetNumRow()Returns the number of rows in this matrix, which is always 3 in this implementation.voidsetElement(int row, int column, double value)Modifies the value at the specified row and column of this matrix.StringtoString()Returns a string representation of this matrix.- 
Methods inherited from class AffineTransformconcatenate, createInverse, createTransformedShape, deltaTransform, deltaTransform, getDeterminant, getMatrix, getQuadrantRotateInstance, getQuadrantRotateInstance, getRotateInstance, getRotateInstance, getRotateInstance, getRotateInstance, getScaleInstance, getScaleX, getScaleY, getShearInstance, getShearX, getShearY, getTranslateInstance, getTranslateX, getTranslateY, getType, hashCode, inverseTransform, inverseTransform, invert, isIdentity, preConcatenate, quadrantRotate, quadrantRotate, rotate, rotate, rotate, rotate, scale, setToIdentity, setToQuadrantRotation, setToQuadrantRotation, setToRotation, setToRotation, setToRotation, setToRotation, setToScale, setToShear, setToTranslation, setTransform, setTransform, shear, transform, transform, transform, transform, transform, transform, translate
 - 
Methods inherited from interface MatrixisIdentity
 
- 
 
- 
- 
- 
Field Detail- 
SIZEpublic static final int SIZE The matrix size, which is 3.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
AffineTransform2Dpublic AffineTransform2D() Creates a new identity matrix.
 - 
AffineTransform2Dpublic AffineTransform2D(AffineTransform transform) Constructs a 3×3 matrix from the specified affine transform.
 - 
AffineTransform2Dpublic AffineTransform2D(Matrix matrix) 
 
- 
 - 
Method Detail- 
getNumRowpublic final int getNumRow() Returns the number of rows in this matrix, which is always 3 in this implementation.
 - 
getNumColpublic final int getNumCol() Returns the number of colmuns in this matrix, which is always 3 in this implementation.
 - 
getElementpublic double getElement(int row, int column)Retrieves the value at the specified row and column of this matrix.- Specified by:
- getElementin interface- Matrix
- Parameters:
- row- The row number to be retrieved (zero indexed).
- column- The column number to be retrieved (zero indexed).
- Returns:
- The value at the indexed element.
 
 - 
setElementpublic void setElement(int row, int column, double value)Modifies the value at the specified row and column of this matrix.- Specified by:
- setElementin interface- Matrix
- Parameters:
- row- The row number to be retrieved (zero indexed).
- column- The column number to be retrieved (zero indexed).
- value- The new matrix element value.
 
 - 
toStringpublic String toString() Returns a string representation of this matrix. The returned string is implementation dependent. It is usually provided for debugging purposes only.- Overrides:
- toStringin class- AffineTransform
 
 - 
clonepublic AffineTransform2D clone() Returns a clone of this affine transform.- Specified by:
- clonein interface- Cloneable
- Specified by:
- clonein interface- Matrix
- Overrides:
- clonein class- AffineTransform
- Returns:
- A clone of this matrix.
- See Also:
- Object.clone()
 
 - 
equalspublic boolean equals(Object obj) - Overrides:
- equalsin class- AffineTransform
 
 
- 
 
-