|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectAffineTransform
AffineTransform2D
public class AffineTransform2D
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 AffineTransform
class and implements
the Matrix
interface. 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 XMatrix
interface because the inherited invert()
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, and isAffine()
would be useless.
Field Summary | |
---|---|
static int |
SIZE
The matrix size, which is 3. |
Fields inherited from class AffineTransform |
---|
TYPE_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 Summary | |
---|---|
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 Summary | |
---|---|
AffineTransform2D |
clone()
Returns a clone of this affine transform. |
double |
getElement(int row,
int column)
Retrieves the value at the specified row and column of this matrix. |
int |
getNumCol()
Returns the number of colmuns in this matrix, which is always 3 in this implementation. |
int |
getNumRow()
Returns the number of rows in this matrix, which is always 3 in this implementation. |
void |
setElement(int row,
int column,
double value)
Modifies the value at the specified row and column of this matrix. |
String |
toString()
Returns a string representation of this matrix. |
Methods inherited from class Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface Matrix |
---|
isIdentity |
Field Detail |
---|
public static final int SIZE
Constructor Detail |
---|
public AffineTransform2D()
public AffineTransform2D(AffineTransform transform)
public AffineTransform2D(Matrix matrix)
Method Detail |
---|
public final int getNumRow()
getNumRow
in interface Matrix
public final int getNumCol()
getNumCol
in interface Matrix
public double getElement(int row, int column)
getElement
in interface Matrix
row
- The row number to be retrieved (zero indexed).column
- The column number to be retrieved (zero indexed).
public void setElement(int row, int column, double value)
setElement
in interface Matrix
row
- The row number to be retrieved (zero indexed).column
- The column number to be retrieved (zero indexed).value
- The new matrix element value.public String toString()
toString
in class AffineTransform
public AffineTransform2D clone()
clone
in interface Matrix
clone
in class AffineTransform
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |