java::awt::geom::AffineTransform Class Reference

Inheritance diagram for java::awt::geom::AffineTransform:

Inheritance graph
java::lang::Object
[legend]
Collaboration diagram for java::awt::geom::AffineTransform:

Collaboration graph
java::lang::Object
[legend]

List of all members.


Detailed Description

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         ]
 

Version:
1.70, 01/23/03
Author:
Jim Graham

Public Types

enum  AFFINE_TYPE {
  TYPE_UNKNOWN = -1, TYPE_IDENTITY = 0, TYPE_TRANSLATION = 1, TYPE_UNIFORM_SCALE = 2,
  TYPE_GENERAL_SCALE = 4, TYPE_MASK_SCALE = (TYPE_UNIFORM_SCALE | TYPE_GENERAL_SCALE), TYPE_QUADRANT_ROTATION = 8, TYPE_GENERAL_ROTATION = 16,
  TYPE_MASK_ROTATION = (TYPE_QUADRANT_ROTATION | TYPE_GENERAL_ROTATION), TYPE_GENERAL_TRANSFORM = 32, TYPE_FLIP = 64
}

Public Member Functions

 AffineTransform ()
 Constructs a new AffineTransform representing the Identity transformation.
 AffineTransform (jdouble m00, jdouble m10, jdouble m01, jdouble m11, jdouble m02, jdouble m12)
 Constructs a new AffineTransform from 6 double precision values representing the 6 specifiable entries of the 3x3 transformation matrix.
 AffineTransform (const Array< 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.
virtual jint getType ()
 Retrieves the flag bits describing the conversion properties of this transform.
virtual jdouble getDeterminant () const
 Returns the determinant of the matrix representation of the transform.
virtual void getMatrix (Array< jdouble > &flatmatrix) const
 Retrieves the 6 specifiable values in the 3x3 affine transformation matrix and places them into an array of double precisions values.
virtual jdouble getScaleX () const
 Returns the X coordinate scaling element (m00) of the 3x3 affine transformation matrix.
virtual jdouble getScaleY () const
 Returns the Y coordinate scaling element (m11) of the 3x3 affine transformation matrix.
virtual jdouble getShearX () const
 Returns the X coordinate shearing element (m01) of the 3x3 affine transformation matrix.
virtual jdouble getShearY () const
 Returns the Y coordinate shearing element (m10) of the 3x3 affine transformation matrix.
virtual jdouble getTranslateX () const
 Returns the X coordinate of the translation element (m02) of the 3x3 affine transformation matrix.
virtual jdouble getTranslateY () const
 Returns the Y coordinate of the translation element (m12) of the 3x3 affine transformation matrix.
virtual void translate (jdouble tx, jdouble ty)
 Concatenates this transform with a translation transformation.
virtual void rotate (jdouble theta)
 Concatenates this transform with a rotation transformation.
virtual void rotate (jdouble theta, jdouble x, jdouble y)
 Concatenates this transform with a transform that rotates coordinates around an anchor point.
virtual void scale (jdouble sx, jdouble sy)
 Concatenates this transform with a scaling transformation.
virtual void shear (jdouble shx, jdouble shy)
 Concatenates this transform with a shearing transformation.
virtual void setToIdentity ()
 Resets this transform to the Identity transform.
virtual void setToTranslation (jdouble tx, jdouble ty)
 Sets this transform to a translation transformation.
virtual void setToRotation (jdouble theta)
 Sets this transform to a rotation transformation.
virtual void setToRotation (jdouble theta, jdouble x, jdouble y)
 Sets this transform to a translated rotation transformation.
virtual void setToScale (jdouble sx, jdouble sy)
 Sets this transform to a scaling transformation.
virtual void setToShear (jdouble shx, jdouble shy)
 Sets this transform to a shearing transformation.
virtual void setTransform (const AffineTransform &t)
 Sets this transform to a copy of the transform in the specified AffineTransform object.
virtual void setTransform (jdouble m00, jdouble m10, jdouble m01, jdouble m11, jdouble m02, jdouble m12)
 Sets this transform to the matrix specified by the 6 double precision values.
virtual void concatenate (const AffineTransform &t)
 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.
virtual void preConcatenate (const AffineTransform &t)
 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.
AffineTransform createInverse () const
 Returns an AffineTransform object representing the inverse transformation.
virtual Point2Dtransform (const Point2D &ptSrc, Ref< Point2D > &ptDst) const
 Transforms the specified ptSrc and stores the result in ptDst.
virtual void transform (const Array< jdouble > &srcPts, jint srcOff, Array< jdouble > &dstPts, jint dstOff, jint numPts) const
 Transforms an array of double precision coordinates by this transform.
virtual Point2DinverseTransform (const Point2D &ptSrc, Ref< Point2D > &ptDst) const
 Inverse transforms the specified ptSrc and stores the result in ptDst.
virtual void inverseTransform (const Array< jdouble > &srcPts, jint srcOff, Array< jdouble > &dstPts, jint dstOff, jint numPts) const
 Inverse transforms an array of double precision coordinates by this transform.
virtual Point2DdeltaTransform (const Point2D &ptSrc, Ref< Point2D > &ptDst) const
 Transforms the relative distance vector specified by ptSrc and stores the result in ptDst.
virtual void deltaTransform (const Array< jdouble > &srcPts, jint srcOff, Array< jdouble > &dstPts, jint dstOff, jint numPts) const
 Transforms an array of relative distance vectors by this transform.
virtual Ref< ShapecreateTransformedShape (const Ref< Shape > &pSrc) const
 Returns a new Shape object defined by the geometry of the specified Shape after it has been transformed by this transform.
virtual String toString () const
 Returns a String that represents the value of this Object.
virtual jboolean isIdentity ()
 Returns true if this AffineTransform is an identity transform.
virtual jint hashCode () const
 Returns the hashcode for this transform.
virtual jboolean equals (const Object &obj) const
 Returns true if this AffineTransform represents the same affine coordinate transform as the specified argument.

Static Public Member Functions

static AffineTransform getTranslateInstance (jdouble tx, jdouble ty)
 Returns a transform representing a translation transformation.
static AffineTransform getRotateInstance (jdouble theta)
 Returns a transform representing a rotation transformation.
static AffineTransform getRotateInstance (jdouble theta, jdouble x, jdouble y)
 Returns a transform that rotates coordinates around an anchor point.
static AffineTransform getScaleInstance (jdouble sx, jdouble sy)
 Returns a transform representing a scaling transformation.
static AffineTransform getShearInstance (jdouble shx, jdouble shy)
 Returns a transform representing a shearing transformation.

Protected Attributes

jdouble m00
 The X coordinate scaling element of the 3x3 affine transformation matrix.
jdouble m10
 The Y coordinate shearing element of the 3x3 affine transformation matrix.
jdouble m01
 The X coordinate shearing element of the 3x3 affine transformation matrix.
jdouble m11
 The Y coordinate scaling element of the 3x3 affine transformation matrix.
jdouble m02
 The X coordinate of the translation element of the 3x3 affine transformation matrix.
jdouble m12
 The Y coordinate of the translation element of the 3x3 affine transformation matrix.
jint state
 This field keeps track of which components of the matrix need to be applied when performing a transformation.

Member Enumeration Documentation

enum java::awt::geom::AffineTransform::AFFINE_TYPE

Enumerator:
TYPE_UNKNOWN 
TYPE_IDENTITY  This constant indicates that the transform defined by this object is an identity transform.

An identity transform is one in which the output coordinates are always the same as the input coordinates. If this transform is anything other than the identity transform, the type will either be the constant GENERAL_TRANSFORM or a combination of the appropriate flag bits for the various coordinate conversions that this transform performs.

See also:
TYPE_TRANSLATION

TYPE_UNIFORM_SCALE

TYPE_GENERAL_SCALE

TYPE_FLIP

TYPE_QUADRANT_ROTATION

TYPE_GENERAL_ROTATION

TYPE_GENERAL_TRANSFORM

getType

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.

A translation moves the coordinates by a constant amount in x and y without changing the length or angle of vectors.

See also:
TYPE_IDENTITY

TYPE_UNIFORM_SCALE

TYPE_GENERAL_SCALE

TYPE_FLIP

TYPE_QUADRANT_ROTATION

TYPE_GENERAL_ROTATION

TYPE_GENERAL_TRANSFORM

getType

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.

A uniform scale multiplies the length of vectors by the same amount in both the x and y directions without changing the angle between vectors. This flag bit is mutually exclusive with the TYPE_GENERAL_SCALE flag.

See also:
TYPE_IDENTITY

TYPE_TRANSLATION

TYPE_GENERAL_SCALE

TYPE_FLIP

TYPE_QUADRANT_ROTATION

TYPE_GENERAL_ROTATION

TYPE_GENERAL_TRANSFORM

getType

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.

A general scale multiplies the length of vectors by different amounts in the x and y directions without changing the angle between perpendicular vectors. This flag bit is mutually exclusive with the TYPE_UNIFORM_SCALE flag.

See also:
TYPE_IDENTITY

TYPE_TRANSLATION

TYPE_UNIFORM_SCALE

TYPE_FLIP

TYPE_QUADRANT_ROTATION

TYPE_GENERAL_ROTATION

TYPE_GENERAL_TRANSFORM

getType

TYPE_MASK_SCALE  This constant is a bit mask for any of the scale flag bits.

See also:
TYPE_UNIFORM_SCALE

TYPE_GENERAL_SCALE

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.

A rotation changes the angles of vectors by the same amount regardless of the original direction of the vector and without changing the length of the vector. This flag bit is mutually exclusive with the TYPE_GENERAL_ROTATION flag.

See also:
TYPE_IDENTITY

TYPE_TRANSLATION

TYPE_UNIFORM_SCALE

TYPE_GENERAL_SCALE

TYPE_FLIP

TYPE_GENERAL_ROTATION

TYPE_GENERAL_TRANSFORM

getType

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.

A rotation changes the angles of vectors by the same amount regardless of the original direction of the vector and without changing the length of the vector. This flag bit is mutually exclusive with the TYPE_QUADRANT_ROTATION flag.

See also:
TYPE_IDENTITY

TYPE_TRANSLATION

TYPE_UNIFORM_SCALE

TYPE_GENERAL_SCALE

TYPE_FLIP

TYPE_QUADRANT_ROTATION

TYPE_GENERAL_TRANSFORM

getType

TYPE_MASK_ROTATION  This constant is a bit mask for any of the rotation flag bits.

See also:
TYPE_QUADRANT_ROTATION

TYPE_GENERAL_ROTATION

TYPE_GENERAL_TRANSFORM  This constant indicates that the transform defined by this object performs an arbitrary conversion of the input coordinates.

If this transform can be classified by any of the above constants, the type will either be the constant TYPE_IDENTITY or a combination of the appropriate flag bits for the various coordinate conversions that this transform performs.

See also:
TYPE_IDENTITY

TYPE_TRANSLATION

TYPE_UNIFORM_SCALE

TYPE_GENERAL_SCALE

TYPE_FLIP

TYPE_QUADRANT_ROTATION

TYPE_GENERAL_ROTATION

getType

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.

A right handed coordinate system is one where the positive X axis rotates counterclockwise to overlay the positive Y axis similar to the direction that the fingers on your right hand curl when you stare end on at your thumb. A left handed coordinate system is one where the positive X axis rotates clockwise to overlay the positive Y axis similar to the direction that the fingers on your left hand curl. There is no mathematical way to determine the angle of the original flipping or mirroring transformation since all angles of flip are identical given an appropriate adjusting rotation.

See also:
TYPE_IDENTITY

TYPE_TRANSLATION

TYPE_UNIFORM_SCALE

TYPE_GENERAL_SCALE

TYPE_QUADRANT_ROTATION

TYPE_GENERAL_ROTATION

TYPE_GENERAL_TRANSFORM

getType


Constructor & Destructor Documentation

java::awt::geom::AffineTransform::AffineTransform (  ) 

Constructs a new AffineTransform representing the Identity transformation.

java::awt::geom::AffineTransform::AffineTransform ( jdouble  m00,
jdouble  m10,
jdouble  m01,
jdouble  m11,
jdouble  m02,
jdouble  m12 
)

Constructs a new AffineTransform from 6 double precision values representing the 6 specifiable entries of the 3x3 transformation matrix.

Parameters:
m00,&nbsp;m01,&nbsp;m02,&nbsp;m10,&nbsp;m11,&nbsp;m12 the 6 floating point values that compose the 3x3 transformation matrix

java::awt::geom::AffineTransform::AffineTransform ( const Array< 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.

The values are retrieved from the array as { m00 m10 m01 m11 [m02 m12]}.

Parameters:
flatmatrix the double array containing the values to be set in the new AffineTransform object. The length of the array is assumed to be at least 4. If the length of the array is less than 6, only the first 4 values are taken. If the length of the array is greater than 6, the first 6 values are taken.


Member Function Documentation

static AffineTransform java::awt::geom::AffineTransform::getTranslateInstance ( jdouble  tx,
jdouble  ty 
) [static]

Returns a transform representing a translation transformation.

The matrix representing the returned transform is:

		[   1    0    tx  ]
		[   0    1    ty  ]
		[   0    0    1   ]
 
Parameters:
tx the distance by which coordinates are translated in the X axis direction
ty the distance by which coordinates are translated in the Y axis direction
Returns:
an AffineTransform object that represents a translation transformation, created with the specified vector.

static AffineTransform java::awt::geom::AffineTransform::getRotateInstance ( jdouble  theta  )  [static]

Returns a transform representing a rotation transformation.

The matrix representing the returned transform is:

		[   cos(theta)    -sin(theta)    0   ]
		[   sin(theta)     cos(theta)    0   ]
		[       0              0         1   ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta the angle of rotation in radians
Returns:
an AffineTransform object that is a rotation transformation, created with the specified angle of rotation.

static AffineTransform java::awt::geom::AffineTransform::getRotateInstance ( jdouble  theta,
jdouble  x,
jdouble  y 
) [static]

Returns a transform that rotates coordinates around an anchor point.

This operation is equivalent to translating the coordinates so that the anchor point is at the origin (S1), then rotating them about the new origin (S2), and finally translating so that the intermediate origin is restored to the coordinates of the original anchor point (S3).

This operation is equivalent to the following sequence of calls:

	    AffineTransform Tx = new AffineTransform();
	    Tx.setToTranslation(x, y);	// S3: final translation
	    Tx.rotate(theta);		// S2: rotate around anchor
	    Tx.translate(-x, -y);	// S1: translate anchor to origin
 
The matrix representing the returned transform is:
		[   cos(theta)    -sin(theta)    x-x*cos+y*sin  ]
		[   sin(theta)     cos(theta)    y-x*sin-y*cos  ]
		[       0              0               1        ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta the angle of rotation in radians
x,&nbsp;y the coordinates of the anchor point of the rotation
Returns:
an AffineTransform object that rotates coordinates around the specified point by the specified angle of rotation.

static AffineTransform java::awt::geom::AffineTransform::getScaleInstance ( jdouble  sx,
jdouble  sy 
) [static]

Returns a transform representing a scaling transformation.

The matrix representing the returned transform is:

		[   sx   0    0   ]
		[   0    sy   0   ]
		[   0    0    1   ]
 
Parameters:
sx the factor by which coordinates are scaled along the X axis direction
sy the factor by which coordinates are scaled along the Y axis direction
Returns:
an AffineTransform object that scales coordinates by the specified factors.

static AffineTransform java::awt::geom::AffineTransform::getShearInstance ( jdouble  shx,
jdouble  shy 
) [static]

Returns a transform representing a shearing transformation.

The matrix representing the returned transform is:

		[   1   shx   0   ]
		[  shy   1    0   ]
		[   0    0    1   ]
 
Parameters:
shx the multiplier by which coordinates are shifted in the direction of the positive X axis as a factor of their Y coordinate
shy the multiplier by which coordinates are shifted in the direction of the positive Y axis as a factor of their X coordinate
Returns:
an AffineTransform object that shears coordinates by the specified multipliers.

virtual jint java::awt::geom::AffineTransform::getType (  )  [virtual]

Retrieves the flag bits describing the conversion properties of this transform.

The return value is either one of the constants TYPE_IDENTITY or TYPE_GENERAL_TRANSFORM, or a combination of the appriopriate flag bits. A valid combination of flag bits is an exclusive OR operation that can combine the TYPE_TRANSLATION flag bit in addition to either of the TYPE_UNIFORM_SCALE or TYPE_GENERAL_SCALE flag bits as well as either of the TYPE_QUADRANT_ROTATION or TYPE_GENERAL_ROTATION flag bits.

Returns:
the OR combination of any of the indicated flags that apply to this transform
See also:
TYPE_IDENTITY

TYPE_TRANSLATION

TYPE_UNIFORM_SCALE

TYPE_GENERAL_SCALE

TYPE_QUADRANT_ROTATION

TYPE_GENERAL_ROTATION

TYPE_GENERAL_TRANSFORM

virtual jdouble java::awt::geom::AffineTransform::getDeterminant (  )  const [virtual]

Returns the determinant of the matrix representation of the transform.

The determinant is useful both to determine if the transform can be inverted and to get a single value representing the combined X and Y scaling of the transform.

If the determinant is non-zero, then this transform is invertible and the various methods that depend on the inverse transform do not need to throw a NoninvertibleTransformException. If the determinant is zero then this transform can not be inverted since the transform maps all input coordinates onto a line or a point. If the determinant is near enough to zero then inverse transform operations might not carry enough precision to produce meaningful results.

If this transform represents a uniform scale, as indicated by the getType method then the determinant also represents the square of the uniform scale factor by which all of the points are expanded from or contracted towards the origin. If this transform represents a non-uniform scale or more general transform then the determinant is not likely to represent a value useful for any purpose other than determining if inverse transforms are possible.

Mathematically, the determinant is calculated using the formula:

		|  m00  m01  m02  |
		|  m10  m11  m12  |  =  m00 * m11 - m01 * m10
		|   0    0    1   |
 

Returns:
the determinant of the matrix used to transform the coordinates.
See also:
getType

createInverse

inverseTransform

TYPE_UNIFORM_SCALE

virtual void java::awt::geom::AffineTransform::getMatrix ( Array< jdouble > &  flatmatrix  )  const [virtual]

Retrieves the 6 specifiable values in the 3x3 affine transformation matrix and places them into an array of double precisions values.

The values are stored in the array as { m00 m10 m01 m11 m02 m12 }. An array of 4 doubles can also be specified, in which case only the first four elements representing the non-transform parts of the array are retrieved and the values are stored into the array as { m00 m10 m01 m11 }

Parameters:
flatmatrix the double array used to store the returned values.
See also:
getScaleX

getScaleY

getShearX

getShearY

getTranslateX

getTranslateY

virtual jdouble java::awt::geom::AffineTransform::getScaleX (  )  const [virtual]

Returns the X coordinate scaling element (m00) of the 3x3 affine transformation matrix.

Returns:
a double value that is the X coordinate of the scaling element of the affine transformation matrix.
See also:
getMatrix

virtual jdouble java::awt::geom::AffineTransform::getScaleY (  )  const [virtual]

Returns the Y coordinate scaling element (m11) of the 3x3 affine transformation matrix.

Returns:
a double value that is the Y coordinate of the scaling element of the affine transformation matrix.
See also:
getMatrix

virtual jdouble java::awt::geom::AffineTransform::getShearX (  )  const [virtual]

Returns the X coordinate shearing element (m01) of the 3x3 affine transformation matrix.

Returns:
a double value that is the X coordinate of the shearing element of the affine transformation matrix.
See also:
getMatrix

virtual jdouble java::awt::geom::AffineTransform::getShearY (  )  const [virtual]

Returns the Y coordinate shearing element (m10) of the 3x3 affine transformation matrix.

Returns:
a double value that is the Y coordinate of the shearing element of the affine transformation matrix.
See also:
getMatrix

virtual jdouble java::awt::geom::AffineTransform::getTranslateX (  )  const [virtual]

Returns the X coordinate of the translation element (m02) of the 3x3 affine transformation matrix.

Returns:
a double value that is the X coordinate of the translation element of the affine transformation matrix.
See also:
getMatrix

virtual jdouble java::awt::geom::AffineTransform::getTranslateY (  )  const [virtual]

Returns the Y coordinate of the translation element (m12) of the 3x3 affine transformation matrix.

Returns:
a double value that is the Y coordinate of the translation element of the affine transformation matrix.
See also:
getMatrix

virtual void java::awt::geom::AffineTransform::translate ( jdouble  tx,
jdouble  ty 
) [virtual]

Concatenates this transform with a translation transformation.

This is equivalent to calling concatenate(T), where T is an AffineTransform represented by the following matrix:

		[   1    0    tx  ]
		[   0    1    ty  ]
		[   0    0    1   ]
 
Parameters:
tx the distance by which coordinates are translated in the X axis direction
ty the distance by which coordinates are translated in the Y axis direction

virtual void java::awt::geom::AffineTransform::rotate ( jdouble  theta  )  [virtual]

Concatenates this transform with a rotation transformation.

This is equivalent to calling concatenate(R), where R is an AffineTransform represented by the following matrix:

		[   cos(theta)    -sin(theta)    0   ]
		[   sin(theta)     cos(theta)    0   ]
		[       0              0         1   ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta the angle of rotation in radians

virtual void java::awt::geom::AffineTransform::rotate ( jdouble  theta,
jdouble  x,
jdouble  y 
) [virtual]

Concatenates this transform with a transform that rotates coordinates around an anchor point.

This operation is equivalent to translating the coordinates so that the anchor point is at the origin (S1), then rotating them about the new origin (S2), and finally translating so that the intermediate origin is restored to the coordinates of the original anchor point (S3).

This operation is equivalent to the following sequence of calls:

		translate(x, y);	// S3: final translation
		rotate(theta);		// S2: rotate around anchor
		translate(-x, -y);	// S1: translate anchor to origin
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta the angle of rotation in radians
x,&nbsp;y the coordinates of the anchor point of the rotation

virtual void java::awt::geom::AffineTransform::scale ( jdouble  sx,
jdouble  sy 
) [virtual]

Concatenates this transform with a scaling transformation.

This is equivalent to calling concatenate(S), where S is an AffineTransform represented by the following matrix:

		[   sx   0    0   ]
		[   0    sy   0   ]
		[   0    0    1   ]
 
Parameters:
sx the factor by which coordinates are scaled along the X axis direction
sy the factor by which coordinates are scaled along the Y axis direction

virtual void java::awt::geom::AffineTransform::shear ( jdouble  shx,
jdouble  shy 
) [virtual]

Concatenates this transform with a shearing transformation.

This is equivalent to calling concatenate(SH), where SH is an AffineTransform represented by the following matrix:

		[   1   shx   0   ]
		[  shy   1    0   ]
		[   0    0    1   ]
 
Parameters:
shx the multiplier by which coordinates are shifted in the direction of the positive X axis as a factor of their Y coordinate
shy the multiplier by which coordinates are shifted in the direction of the positive Y axis as a factor of their X coordinate

virtual void java::awt::geom::AffineTransform::setToIdentity (  )  [virtual]

Resets this transform to the Identity transform.

virtual void java::awt::geom::AffineTransform::setToTranslation ( jdouble  tx,
jdouble  ty 
) [virtual]

Sets this transform to a translation transformation.

The matrix representing this transform becomes:

		[   1    0    tx  ]
		[   0    1    ty  ]
		[   0    0    1   ]
 
Parameters:
tx the distance by which coordinates are translated in the X axis direction
ty the distance by which coordinates are translated in the Y axis direction

virtual void java::awt::geom::AffineTransform::setToRotation ( jdouble  theta  )  [virtual]

Sets this transform to a rotation transformation.

The matrix representing this transform becomes:

		[   cos(theta)    -sin(theta)    0   ]
		[   sin(theta)     cos(theta)    0   ]
		[       0              0         1   ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta the angle of rotation in radians

virtual void java::awt::geom::AffineTransform::setToRotation ( jdouble  theta,
jdouble  x,
jdouble  y 
) [virtual]

Sets this transform to a translated rotation transformation.

This operation is equivalent to translating the coordinates so that the anchor point is at the origin (S1), then rotating them about the new origin (S2), and finally translating so that the intermediate origin is restored to the coordinates of the original anchor point (S3).

This operation is equivalent to the following sequence of calls:

	    setToTranslation(x, y);	// S3: final translation
	    rotate(theta);		// S2: rotate around anchor
	    translate(-x, -y);		// S1: translate anchor to origin
 
The matrix representing this transform becomes:
		[   cos(theta)    -sin(theta)    x-x*cos+y*sin  ]
		[   sin(theta)     cos(theta)    y-x*sin-y*cos  ]
		[       0              0               1        ]
 
Rotating with a positive angle theta rotates points on the positive x axis toward the positive y axis.
Parameters:
theta the angle of rotation in radians
x,&nbsp;y the coordinates of the anchor point of the rotation

virtual void java::awt::geom::AffineTransform::setToScale ( jdouble  sx,
jdouble  sy 
) [virtual]

Sets this transform to a scaling transformation.

The matrix representing this transform becomes:

		[   sx   0    0   ]
		[   0    sy   0   ]
		[   0    0    1   ]
 
Parameters:
sx the factor by which coordinates are scaled along the X axis direction
sy the factor by which coordinates are scaled along the Y axis direction

virtual void java::awt::geom::AffineTransform::setToShear ( jdouble  shx,
jdouble  shy 
) [virtual]

Sets this transform to a shearing transformation.

The matrix representing this transform becomes:

		[   1   shx   0   ]
		[  shy   1    0   ]
		[   0    0    1   ]
 
Parameters:
shx the multiplier by which coordinates are shifted in the direction of the positive X axis as a factor of their Y coordinate
shy the multiplier by which coordinates are shifted in the direction of the positive Y axis as a factor of their X coordinate

virtual void java::awt::geom::AffineTransform::setTransform ( const AffineTransform t  )  [virtual]

Sets this transform to a copy of the transform in the specified AffineTransform object.

Parameters:
Tx the AffineTransform object from which to copy the transform

virtual void java::awt::geom::AffineTransform::setTransform ( jdouble  m00,
jdouble  m10,
jdouble  m01,
jdouble  m11,
jdouble  m02,
jdouble  m12 
) [virtual]

Sets this transform to the matrix specified by the 6 double precision values.

Parameters:
m00,&nbsp;m01,&nbsp;m02,&nbsp;m10,&nbsp;m11,&nbsp;m12 the 6 floating point values that compose the 3x3 transformation matrix

virtual void java::awt::geom::AffineTransform::concatenate ( const AffineTransform t  )  [virtual]

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.

Cx is updated to perform the combined transformation. Transforming a point p by the updated transform Cx' is equivalent to first transforming p by Tx and then transforming the result by the original transform Cx like this: Cx'(p) = Cx(Tx(p)) In matrix notation, if this transform Cx is represented by the matrix [this] and Tx is represented by the matrix [Tx] then this method does the following:

		[this] = [this] x [Tx]
 
Parameters:
Tx the AffineTransform object to be concatenated with this AffineTransform object.
See also:
preConcatenate

virtual void java::awt::geom::AffineTransform::preConcatenate ( const AffineTransform t  )  [virtual]

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.

Cx is updated to perform the combined transformation. Transforming a point p by the updated transform Cx' is equivalent to first transforming p by the original transform Cx and then transforming the result by Tx like this: Cx'(p) = Tx(Cx(p)) In matrix notation, if this transform Cx is represented by the matrix [this] and Tx is represented by the matrix [Tx] then this method does the following:

		[this] = [Tx] x [this]
 
Parameters:
Tx the AffineTransform object to be concatenated with this AffineTransform object.
See also:
concatenate

AffineTransform java::awt::geom::AffineTransform::createInverse (  )  const

Returns an AffineTransform object representing the inverse transformation.

The inverse transform Tx' of this transform Tx maps coordinates transformed by Tx back to their original coordinates. In other words, Tx'(Tx(p)) = p = Tx(Tx'(p)).

If this transform maps all coordinates onto a point or a line then it will not have an inverse, since coordinates that do not lie on the destination point or line will not have an inverse mapping. The getDeterminant method can be used to determine if this transform has no inverse, in which case an exception will be thrown if the createInverse method is called.

Returns:
a new AffineTransform object representing the inverse transformation.
See also:
getDeterminant
Exceptions:
NoninvertibleTransformException if the matrix cannot be inverted.

virtual Point2D& java::awt::geom::AffineTransform::transform ( const Point2D ptSrc,
Ref< Point2D > &  ptDst 
) const [virtual]

Transforms the specified ptSrc and stores the result in ptDst.

If ptDst is null, a new Point2D object is allocated and then the result of the transformation is stored in this object. In either case, ptDst, which contains the transformed point, is returned for convenience. If ptSrc and ptDst are the same object, the input point is correctly overwritten with the transformed point.

Parameters:
ptSrc the specified Point2D to be transformed
ptDst the specified Point2D that stores the result of transforming ptSrc
Returns:
the ptDst after transforming ptSrc and stroring the result in ptDst.

virtual void java::awt::geom::AffineTransform::transform ( const Array< jdouble > &  srcPts,
jint  srcOff,
Array< jdouble > &  dstPts,
jint  dstOff,
jint  numPts 
) const [virtual]

Transforms an array of double precision coordinates by this transform.

The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the indicated offset in the order [x0, y0, x1, y1, ..., xn, yn].

Parameters:
srcPts the array containing the source point coordinates. Each point is stored as a pair of x, y coordinates.
dstPts the array into which the transformed point coordinates are returned. Each point is stored as a pair of x, y coordinates.
srcOff the offset to the first point to be transformed in the source array
dstOff the offset to the location of the first transformed point that is stored in the destination array
numPts the number of point objects to be transformed

virtual Point2D& java::awt::geom::AffineTransform::inverseTransform ( const Point2D ptSrc,
Ref< Point2D > &  ptDst 
) const [virtual]

Inverse transforms the specified ptSrc and stores the result in ptDst.

If ptDst is null, a new Point2D object is allocated and then the result of the transform is stored in this object. In either case, ptDst, which contains the transformed point, is returned for convenience. If ptSrc and ptDst are the same object, the input point is correctly overwritten with the transformed point.

Parameters:
ptSrc the point to be inverse transformed
ptDst the resulting transformed point
Returns:
ptDst, which contains the result of the inverse transform.
Exceptions:
NoninvertibleTransformException if the matrix cannot be inverted.

virtual void java::awt::geom::AffineTransform::inverseTransform ( const Array< jdouble > &  srcPts,
jint  srcOff,
Array< jdouble > &  dstPts,
jint  dstOff,
jint  numPts 
) const [virtual]

Inverse transforms an array of double precision coordinates by this transform.

The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the specified offset in the order [x0, y0, x1, y1, ..., xn, yn].

Parameters:
srcPts the array containing the source point coordinates. Each point is stored as a pair of x, y coordinates.
dstPts the array into which the transformed point coordinates are returned. Each point is stored as a pair of x, y coordinates.
srcOff the offset to the first point to be transformed in the source array
dstOff the offset to the location of the first transformed point that is stored in the destination array
numPts the number of point objects to be transformed
Exceptions:
NoninvertibleTransformException if the matrix cannot be inverted.

virtual Point2D& java::awt::geom::AffineTransform::deltaTransform ( const Point2D ptSrc,
Ref< Point2D > &  ptDst 
) const [virtual]

Transforms the relative distance vector specified by ptSrc and stores the result in ptDst.

A relative distance vector is transformed without applying the translation components of the affine transformation matrix using the following equations:

	[  x' ]   [  m00  m01 (m02) ] [  x  ]   [ m00x + m01y ]
	[  y' ] = [  m10  m11 (m12) ] [  y  ] = [ m10x + m11y ]
	[ (1) ]   [  (0)  (0) ( 1 ) ] [ (1) ]   [     (1)     ]
 
If ptDst is null, a new Point2D object is allocated and then the result of the transform is stored in this object. In either case, ptDst, which contains the transformed point, is returned for convenience. If ptSrc and ptDst are the same object, the input point is correctly overwritten with the transformed point.
Parameters:
ptSrc the distance vector to be delta transformed
ptDst the resulting transformed distance vector
Returns:
ptDst, which contains the result of the transformation.

virtual void java::awt::geom::AffineTransform::deltaTransform ( const Array< jdouble > &  srcPts,
jint  srcOff,
Array< jdouble > &  dstPts,
jint  dstOff,
jint  numPts 
) const [virtual]

Transforms an array of relative distance vectors by this transform.

A relative distance vector is transformed without applying the translation components of the affine transformation matrix using the following equations:

	[  x' ]   [  m00  m01 (m02) ] [  x  ]   [ m00x + m01y ]
	[  y' ] = [  m10  m11 (m12) ] [  y  ] = [ m10x + m11y ]
	[ (1) ]   [  (0)  (0) ( 1 ) ] [ (1) ]   [     (1)     ]
 
The two coordinate array sections can be exactly the same or can be overlapping sections of the same array without affecting the validity of the results. This method ensures that no source coordinates are overwritten by a previous operation before they can be transformed. The coordinates are stored in the arrays starting at the indicated offset in the order [x0, y0, x1, y1, ..., xn, yn].
Parameters:
srcPts the array containing the source distance vectors. Each vector is stored as a pair of relative x, y coordinates.
dstPts the array into which the transformed distance vectors are returned. Each vector is stored as a pair of relative x, y coordinates.
srcOff the offset to the first vector to be transformed in the source array
dstOff the offset to the location of the first transformed vector that is stored in the destination array
numPts the number of vector coordinate pairs to be transformed

virtual Ref<Shape> java::awt::geom::AffineTransform::createTransformedShape ( const Ref< Shape > &  pSrc  )  const [virtual]

Returns a new Shape object defined by the geometry of the specified Shape after it has been transformed by this transform.

Parameters:
pSrc the specified Shape object to be transformed by this transform.
Returns:
a new Shape object that defines the geometry of the transformed Shape.

virtual String java::awt::geom::AffineTransform::toString (  )  const [virtual]

Returns a String that represents the value of this Object.

Returns:
a String representing the value of this Object.

Reimplemented from java::lang::Object.

virtual jboolean java::awt::geom::AffineTransform::isIdentity (  )  [virtual]

Returns true if this AffineTransform is an identity transform.

Returns:
true if this AffineTransform is an identity transform; false otherwise.

virtual jint java::awt::geom::AffineTransform::hashCode (  )  const [virtual]

Returns the hashcode for this transform.

Returns:
a hash code for this transform.

Reimplemented from java::lang::Object.

virtual jboolean java::awt::geom::AffineTransform::equals ( const Object obj  )  const [virtual]

Returns true if this AffineTransform represents the same affine coordinate transform as the specified argument.

Parameters:
obj the Object to test for equality with this AffineTransform
Returns:
true if obj equals this AffineTransform object; false otherwise.

Reimplemented from java::lang::Object.


Member Data Documentation

jdouble java::awt::geom::AffineTransform::m00 [protected]

The X coordinate scaling element of the 3x3 affine transformation matrix.

jdouble java::awt::geom::AffineTransform::m10 [protected]

The Y coordinate shearing element of the 3x3 affine transformation matrix.

jdouble java::awt::geom::AffineTransform::m01 [protected]

The X coordinate shearing element of the 3x3 affine transformation matrix.

jdouble java::awt::geom::AffineTransform::m11 [protected]

The Y coordinate scaling element of the 3x3 affine transformation matrix.

jdouble java::awt::geom::AffineTransform::m02 [protected]

The X coordinate of the translation element of the 3x3 affine transformation matrix.

jdouble java::awt::geom::AffineTransform::m12 [protected]

The Y coordinate of the translation element of the 3x3 affine transformation matrix.

jint java::awt::geom::AffineTransform::state [protected]

This field keeps track of which components of the matrix need to be applied when performing a transformation.

See also:
APPLY_IDENTITY

APPLY_TRANSLATE

APPLY_SCALE

APPLY_SHEAR


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:21 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3