API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt.geom. AffineTransform View Source
Author(s)
Jim Graham
Since
1.2
Version
1.77, 03/09/06
Serial
Hierarchy
 Object
      AffineTransform
Implements
 Cloneable
 Serializable
Subclasses
Description
public class AffineTransform
  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.
See also:   
Constructors
public AffineTransform ()
  Constructs a new AffineTransform representing the Identity transformation.
public AffineTransform (AffineTransform Tx)
  Constructs a new AffineTransform that is a copy of the specified AffineTransform object.
public AffineTransform (double[] flatmatrix)
  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.
public AffineTransform (double m00, double m10, double m01, double m11, double m02, double m12)
  Constructs a new AffineTransform from 6 double precision values representing the 6 specifiable entries of the 3x3 transformation matrix.
private AffineTransform (double m00, double m10, double m01, double m11, double m02, double m12, int state)
public AffineTransform (float[] flatmatrix)
  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.
public AffineTransform (float m00, float m10, float m01, float m11, float m02, float m12)
  Constructs a new AffineTransform from 6 floating point values representing the 6 specifiable entries of the 3x3 transformation matrix.
Methods
Hide/Show inherited methods
public Object clone ()
  Returns a copy of this AffineTransform object.
public void concatenate (AffineTransform Tx)
  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.
public AffineTransform createInverse () throws NoninvertibleTransformException
  Returns an AffineTransform object representing the inverse transformation.
public Shape createTransformedShape (Shape pSrc)
  Returns a new Shape object defined by the geometry of the specified Shape after it has been transformed by this transform.
public void deltaTransform (double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
  Transforms an array of relative distance vectors by this transform.
public Point2D deltaTransform (Point2D ptSrc, Point2D ptDst)
  Transforms the relative distance vector specified by ptSrc and stores the result in ptDst.
public boolean equals (Object obj)
  Returns true if this AffineTransform represents the same affine coordinate transform as the specified argument.
public double getDeterminant ()
  Returns the determinant of the matrix representation of the transform.
public void getMatrix (double[] flatmatrix)
  Retrieves the 6 specifiable values in the 3x3 affine transformation matrix and places them into an array of double precisions values.
publicstatic AffineTransform getQuadrantRotateInstance (int numquadrants)
  Returns a transform that rotates coordinates by the specified number of quadrants.
publicstatic AffineTransform getQuadrantRotateInstance (int numquadrants, double anchorx, double anchory)
  Returns a transform that rotates coordinates by the specified number of quadrants around the specified anchor point.
publicstatic AffineTransform getRotateInstance (double theta)
  Returns a transform representing a rotation transformation.
publicstatic AffineTransform getRotateInstance (double vecx, double vecy)
  Returns a transform that rotates coordinates according to a rotation vector.
publicstatic AffineTransform getRotateInstance (double theta, double anchorx, double anchory)
  Returns a transform that rotates coordinates around an anchor point.
publicstatic AffineTransform getRotateInstance (double vecx, double vecy, double anchorx, double anchory)
  Returns a transform that rotates coordinates around an anchor point accordinate to a rotation vector.
publicstatic AffineTransform getScaleInstance (double sx, double sy)
  Returns a transform representing a scaling transformation.
public double getScaleX ()
  Returns the X coordinate scaling element (m00) of the 3x3 affine transformation matrix.
public double getScaleY ()
  Returns the Y coordinate scaling element (m11) of the 3x3 affine transformation matrix.
publicstatic AffineTransform getShearInstance (double shx, double shy)
  Returns a transform representing a shearing transformation.
public double getShearX ()
  Returns the X coordinate shearing element (m01) of the 3x3 affine transformation matrix.
public double getShearY ()
  Returns the Y coordinate shearing element (m10) of the 3x3 affine transformation matrix.
publicstatic AffineTransform getTranslateInstance (double tx, double ty)
  Returns a transform representing a translation transformation.
public double getTranslateX ()
  Returns the X coordinate of the translation element (m02) of the 3x3 affine transformation matrix.
public double getTranslateY ()
  Returns the Y coordinate of the translation element (m12) of the 3x3 affine transformation matrix.
public int getType ()
  Retrieves the flag bits describing the conversion properties of this transform.
public int hashCode ()
  Returns the hashcode for this transform.
public void inverseTransform (double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts) throws NoninvertibleTransformException
  Inverse transforms an array of double precision coordinates by this transform.
public Point2D inverseTransform (Point2D ptSrc, Point2D ptDst) throws NoninvertibleTransformException
  Inverse transforms the specified ptSrc and stores the result in ptDst.
public void invert () throws NoninvertibleTransformException
  Sets this transform to the inverse of itself.
public boolean isIdentity ()
  Returns true if this AffineTransform is an identity transform.
public void preConcatenate (AffineTransform Tx)
  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.
public void quadrantRotate (int numquadrants)
  Concatenates this transform with a transform that rotates coordinates by the specified number of quadrants.
public void quadrantRotate (int numquadrants, double anchorx, double anchory)
  Concatenates this transform with a transform that rotates coordinates by the specified number of quadrants around the specified anchor point.
public void rotate (double theta)
  Concatenates this transform with a rotation transformation.
public void rotate (double vecx, double vecy)
  Concatenates this transform with a transform that rotates coordinates according to a rotation vector.
public void rotate (double theta, double anchorx, double anchory)
  Concatenates this transform with a transform that rotates coordinates around an anchor point.
public void rotate (double vecx, double vecy, double anchorx, double anchory)
  Concatenates this transform with a transform that rotates coordinates around an anchor point according to a rotation vector.
public void scale (double sx, double sy)
  Concatenates this transform with a scaling transformation.
public void setToIdentity ()
  Resets this transform to the Identity transform.
public void setToQuadrantRotation (int numquadrants)
  Sets this transform to a rotation transformation that rotates coordinates by the specified number of quadrants.
public void setToQuadrantRotation (int numquadrants, double anchorx, double anchory)
  Sets this transform to a translated rotation transformation that rotates coordinates by the specified number of quadrants around the specified anchor point.
public void setToRotation (double theta)
  Sets this transform to a rotation transformation.
public void setToRotation (double vecx, double vecy)
  Sets this transform to a rotation transformation that rotates coordinates according to a rotation vector.
public void setToRotation (double theta, double anchorx, double anchory)
  Sets this transform to a translated rotation transformation.
public void setToRotation (double vecx, double vecy, double anchorx, double anchory)
  Sets this transform to a rotation transformation that rotates coordinates around an anchor point according to a rotation vector.
public void setToScale (double sx, double sy)
  Sets this transform to a scaling transformation.
public void setToShear (double shx, double shy)
  Sets this transform to a shearing transformation.
public void setToTranslation (double tx, double ty)
  Sets this transform to a translation transformation.
public void setTransform (AffineTransform Tx)
  Sets this transform to a copy of the transform in the specified AffineTransform object.
public void setTransform (double m00, double m10, double m01, double m11, double m02, double m12)
  Sets this transform to the matrix specified by the 6 double precision values.
public void shear (double shx, double shy)
  Concatenates this transform with a shearing transformation.
public String toString ()
  Returns a String that represents the value of this Object.
public void transform (double[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
  Transforms an array of double precision coordinates by this transform.
public void transform (double[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
  Transforms an array of double precision coordinates by this transform and stores the results into an array of floats.
public void transform (float[] srcPts, int srcOff, double[] dstPts, int dstOff, int numPts)
  Transforms an array of floating point coordinates by this transform and stores the results into an array of doubles.
public void transform (float[] srcPts, int srcOff, float[] dstPts, int dstOff, int numPts)
  Transforms an array of floating point coordinates by this transform.
public void transform (Point2D ptSrc, int srcOff, Point2D ptDst, int dstOff, int numPts)
  Transforms an array of point objects by this transform.
public Point2D transform (Point2D ptSrc, Point2D ptDst)
  Transforms the specified ptSrc and stores the result in ptDst.
public void translate (double tx, double ty)
  Concatenates this transform with a translation transformation.
pack-private void updateState ()
  Manually recalculates the state of the transform when the matrix changes too much to predict the effects on the state.
Fields
Hide/Show inherited fields
pack-privatefinalstatic int APPLY_IDENTITY = "0"
  This constant is used for the internal state variable to indicate that no calculations need to be performed and that the source coordinates only need to be copied to their destinations to complete the transformation equation of this transform.
pack-privatefinalstatic int APPLY_SCALE = "2"
  This constant is used for the internal state variable to indicate that the scaling components of the matrix (m00 and m11) need to be factored in to complete the transformation equation of this transform.
pack-privatefinalstatic int APPLY_SHEAR = "4"
  This constant is used for the internal state variable to indicate that the shearing components of the matrix (m01 and m10) need to be factored in to complete the transformation equation of this transform.
pack-privatefinalstatic int APPLY_TRANSLATE = "1"
  This constant is used for the internal state variable to indicate that the translation components of the matrix (m02 and m12) need to be added to complete the transformation equation of this transform.
pack-private double m00
The X coordinate scaling element of the 3x3 affine transformation matrix.
pack-private double m01
The X coordinate shearing element of the 3x3 affine transformation matrix.
pack-private double m02
The X coordinate of the translation element of the 3x3 affine transformation matrix.
pack-private double m10
The Y coordinate shearing element of the 3x3 affine transformation matrix.
pack-private double m11
The Y coordinate scaling element of the 3x3 affine transformation matrix.
pack-private double m12
The Y coordinate of the translation element of the 3x3 affine transformation matrix.
pack-privatetransient int state
  This field keeps track of which components of the matrix need to be applied when performing a transformation.
publicfinalstatic int TYPE_FLIP = "64"
  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.
publicfinalstatic int TYPE_GENERAL_ROTATION = "16"
  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.
publicfinalstatic int TYPE_GENERAL_SCALE = "4"
  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.
publicfinalstatic int TYPE_GENERAL_TRANSFORM = "32"
  This constant indicates that the transform defined by this object performs an arbitrary conversion of the input coordinates.
publicfinalstatic int TYPE_IDENTITY = "0"
  This constant indicates that the transform defined by this object is an identity transform.
publicfinalstatic int TYPE_MASK_ROTATION = "24"
  This constant is a bit mask for any of the rotation flag bits.
publicfinalstatic int TYPE_MASK_SCALE = "6"
  This constant is a bit mask for any of the scale flag bits.
publicfinalstatic int TYPE_QUADRANT_ROTATION = "8"
  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.
publicfinalstatic int TYPE_TRANSLATION = "1"
  This flag bit indicates that the transform defined by this object performs a translation in addition to the conversions indicated by other flag bits.
publicfinalstatic int TYPE_UNIFORM_SCALE = "2"
  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.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar