org.geotools.referencing.operation.matrix
Class AffineTransform2D

java.lang.Object
  extended byjava.awt.geom.AffineTransform
      extended byorg.geotools.referencing.operation.matrix.AffineTransform2D
All Implemented Interfaces:
org.opengis.util.Cloneable, java.lang.Cloneable, org.opengis.referencing.operation.Matrix, java.io.Serializable

public class AffineTransform2D
extends java.awt.geom.AffineTransform
implements org.opengis.referencing.operation.Matrix

An affine matrix of fixed {@value}×{@value} size. Here, the term "affine" means a matrix with the last row fixed to 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 method (new in J2SE 1.6) declares a checked exception, would be an unsupported operation (because it is not possible to change the value at ), would fails in most cases, and would be useless.

Since:
2.3
Version:
$Id: AffineTransform2D.java 17964 2006-02-10 11:27:41Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Field Summary
static int SIZE
          The matrix size, which is 3.
 
Fields inherited from class java.awt.geom.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(java.awt.geom.AffineTransform transform)
          Constructs a 3×3 matrix from the specified affine transform.
AffineTransform2D(org.opengis.referencing.operation.Matrix matrix)
          Creates a new matrix initialized to the same value than the specified one.
 
Method Summary
 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 {@value} in this implementation.
 int getNumRow()
          Returns the number of rows in this matrix, which is always {@value} in this implementation.
 void setElement(int row, int column, double value)
          Modifies the value at the specified row and column of this matrix.
 java.lang.String toString()
          Returns a string representation of this matrix.
 
Methods inherited from class java.awt.geom.AffineTransform
clone, concatenate, createInverse, createTransformedShape, deltaTransform, deltaTransform, equals, getDeterminant, getMatrix, getRotateInstance, getRotateInstance, getScaleInstance, getScaleX, getScaleY, getShearInstance, getShearX, getShearY, getTranslateInstance, getTranslateX, getTranslateY, getType, hashCode, inverseTransform, inverseTransform, isIdentity, preConcatenate, rotate, rotate, scale, setToIdentity, setToRotation, setToRotation, setToScale, setToShear, setToTranslation, setTransform, setTransform, shear, transform, transform, transform, transform, transform, transform, translate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opengis.referencing.operation.Matrix
clone, isIdentity
 

Field Detail

SIZE

public static final int SIZE
The matrix size, which is 3.

See Also:
Constant Field Values
Constructor Detail

AffineTransform2D

public AffineTransform2D()
Creates a new identity matrix.


AffineTransform2D

public AffineTransform2D(java.awt.geom.AffineTransform transform)
Constructs a 3×3 matrix from the specified affine transform.


AffineTransform2D

public AffineTransform2D(org.opengis.referencing.operation.Matrix matrix)
Creates a new matrix initialized to the same value than the specified one. The specified matrix size must be {@value}×{@value}.

Method Detail

getNumRow

public final int getNumRow()
Returns the number of rows in this matrix, which is always {@value} in this implementation.

Specified by:
getNumRow in interface org.opengis.referencing.operation.Matrix

getNumCol

public final int getNumCol()
Returns the number of colmuns in this matrix, which is always {@value} in this implementation.

Specified by:
getNumCol in interface org.opengis.referencing.operation.Matrix

getElement

public double getElement(int row,
                         int column)
Retrieves the value at the specified row and column of this matrix.

Specified by:
getElement in interface org.opengis.referencing.operation.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.

setElement

public void setElement(int row,
                       int column,
                       double value)
Modifies the value at the specified row and column of this matrix.

Specified by:
setElement in interface org.opengis.referencing.operation.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.

toString

public java.lang.String toString()
Returns a string representation of this matrix. The returned string is implementation dependent. It is usually provided for debugging purposes only.



Copyright © GeoTools. All Rights Reserved.