| java.lang.Object com.sun.perseus.j2d.Transform
Transform | public class Transform implements SVGMatrix(Code) | | Class for 2D transforms.
version: $Id: Transform.java,v 1.8 2006/04/21 06:35:16 st125089 Exp $ |
Field Summary | |
float | m0 The (0, 0) component of this 3x3 transformation matrix. | float | m1 The (1, 0) component of this 3x3 transformation matrix. | float | m2 The (0, 1) component of this 3x3 transformation matrix. | float | m3 The (1, 1) component of this 3x3 transformation matrix. | float | m4 The (0, 2) component of this 3x3 transformation matrix. | float | m5 The (1, 2) component of this 3x3 transformation matrix. |
Constructor Summary | |
public | Transform(float m0, float m1, float m2, float m3, float m4, float m5) | public | Transform(SVGMatrix transform) Constructs an Transform representing the same
transform as the given Transform . |
m0 | float m0(Code) | | The (0, 0) component of this 3x3 transformation matrix.
|
m1 | float m1(Code) | | The (1, 0) component of this 3x3 transformation matrix.
|
m2 | float m2(Code) | | The (0, 1) component of this 3x3 transformation matrix.
|
m3 | float m3(Code) | | The (1, 1) component of this 3x3 transformation matrix.
|
m4 | float m4(Code) | | The (0, 2) component of this 3x3 transformation matrix.
|
m5 | float m5(Code) | | The (1, 2) component of this 3x3 transformation matrix.
|
Transform | public Transform(float m0, float m1, float m2, float m3, float m4, float m5)(Code) | | Constructs an Transform with a given set of
components, representing the transform:
x' = m0*x + m2*y + m4
y' = m1*x + m3*y + m5
or, representing the matrix:
[ m0 m2 m4 ]
[ m1 m3 m5 ]
[ 0 0 1 ]
Parameters: m0 - (0, 0) matrix value Parameters: m1 - (1, 0) matrix value Parameters: m2 - (0, 1) matrix value Parameters: m3 - (1, 1) matrix value Parameters: m4 - (0, 2) matrix value Parameters: m5 - (1, 2) matrix value |
Transform | public Transform(SVGMatrix transform)(Code) | | Constructs an Transform representing the same
transform as the given Transform . Future changes
to the object supplied as the transform parameter
will not affect the newly constructed Transform .
If transform is null, the matrix is initialized
to be the identity matrix.
Parameters: transform - defines the initialstate for the newly constructed Transform . |
equals | public boolean equals(Object obj)(Code) | | true if obj is a Transform and all its components are the same as this instance. |
equals | public boolean equals(float[][] m)(Code) | | Parameters: a - 6x1 float array containing the transform matrix. true if this transform is equal to the input matrix. |
getComponent | public float getComponent(int index) throws DOMException(Code) | | The components of the matrix denoted a to f in the API are :
[ a c e ]
[ b d f ]
[ 0 0 1 ]
Parameters: index - component index for this matrix the component of the matrix corresponding to the index. throws: DOMException - - INDEX_SIZE_ERR if the index is invalid. |
inverse | public SVGMatrix inverse() throws SVGException(Code) | | Returns the inverse matrix.
the inverted matrix. throws: SVGException - - SVG_MATRIX_NOT_INVERTABLE when determinant of this matrix is zero. |
inverse | public SVGMatrix inverse(SVGMatrix txf) throws SVGException(Code) | | Inverses this transform and stores the resulting transform into
the input transform.
Parameters: txf - the SVGMatrix into which the result should be stored. throws: SVGException - - SVG_MATRIX_NOT_INVERTABLE when determinant of this matrix is zero. |
isIdentity | public boolean isIdentity()(Code) | | Returns true if the current SVGMatrix
is equivalent to the identity matrix, false
otherwise.
true if this matrix is identity, false otherwise. |
isInvertible | public boolean isInvertible()(Code) | | Returns true if the matrix is invertible.
true if the matrix is invertible. |
mScale | public SVGMatrix mScale(float scaleFactorX, float scaleFactorY)(Code) | | Post-multiplies a scale transformation on the current matrix and
returns the resulting matrix.
[ scaleFactorX 0 0 ]
[ 0 scaleFactorY 0 ]
[ 0 0 1 ]
Parameters: scaleFactorX - the factor by which coordinates are scaled along theX axis direction. Parameters: scaleFactorY - the factor by which coordinates are scaled along theY axis direction. this matrix scaled by the scaleFactor. |
setTransform | public void setTransform(float m0, float m1, float m2, float m3, float m4, float m5)(Code) | | Sets the transform to the matrix defined by the input parameters:
[ m0 m2 m4 ]
[ m1 m3 m5 ]
[ 0 0 1 ]
Parameters: m0 - (0, 0) matrix value Parameters: m1 - (1, 0) matrix value Parameters: m2 - (0, 1) matrix value Parameters: m3 - (1, 1) matrix value Parameters: m4 - (0, 2) matrix value Parameters: m5 - (1, 2) matrix value |
setTransform | public void setTransform(SVGMatrix transform)(Code) | | Sets the transform to the value defined by the input matrix.
Parameters: transform - the transform whose value should be copied. If null,this transform is set to identity. |
transformPoint | public void transformPoint(float[] pt, float[] opt)(Code) | | Transforms a point's coordinates.
Parameters: pt - the point to transform Parameters: opt - the transformed point coordinates. |
|
|