|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This interface represents an "SVGMatrix" datatype, identified by an affine transform. It can be used to read and modify the values of transform attribute as per SVG specification. Note that the mTranslate, mMultiply, mScale and mRotate methods in this interface mutate the SVGMatrix object and return a reference to the SVGMatrix instance itself, after performing the necessary matrix operation.
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' ] [ a c e ] [ x ] [ a.x + c.y + e ]
[ y' ] = [ b d f ] [ y ] = [ b.x + d.y + f ]
[ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
| Method Summary | ||
float |
getComponent(int index)
Returns a component of the matrix by component's zero-based index. |
|
SVGMatrix |
inverse()
Returns a new instance of SVGMatrix containing the inverse of the current matrix. |
|
SVGMatrix |
mMultiply(SVGMatrix secondMatrix)
Performs matrix multiplication. |
|
SVGMatrix |
mRotate(float angle)
Post-multiplies a rotation transformation on the current matrix and returns the resulting current matrix. |
|
SVGMatrix |
mScale(float scaleFactor)
Post-multiplies a uniform scale transformation on the current matrix and returns the resulting current matrix. |
|
SVGMatrix |
mTranslate(float x,
float y)
Post-multiplies a translation transformation on the current matrix and returns the resulting current matrix. |
|
| Method Detail |
public float getComponent(int index)
throws DOMException
Returns a component of the matrix by component's zero-based index. getComponent(0) is a, getComponent(1) is b, etc.
index - the index of the matrix component to retrieve.DOMException - INDEX_SIZE_ERR if the index is invalid.public SVGMatrix inverse() throws SVGException
Returns a new instance of SVGMatrix containing the inverse of the current matrix.
SVGException - SVG_MATRIX_NOT_INVERTABLE when determinant of this matrix is zero.public SVGMatrix mMultiply(SVGMatrix secondMatrix)
Performs matrix multiplication. This matrix is post-multiplied by another matrix, returning the resulting current matrix.
secondMatrix - the matrix to post-multiply with.NullPointerException - if secondMatrix is null.public SVGMatrix mRotate(float angle)
Post-multiplies a rotation transformation on the current matrix and returns the resulting current matrix.
This is equivalent to calling multiply(R), where R is an
SVGMatrix object represented by the following matrix:
[ cos(angle) -sin(angle) 0 ]
[ sin(angle) cos(angle) 0 ]
[ 0 0 1 ]
angle - the angle of rotation in degrees.public SVGMatrix mScale(float scaleFactor)
Post-multiplies a uniform scale transformation on the current matrix and returns the resulting current matrix.
This is equivalent to calling multiply(S), where S is an SVGMatrix
object represented by the following matrix:
[ scaleFactor 0 0 ]
[ 0 scaleFactor 0 ]
[ 0 0 1 ]
scaleFactor - the factor by which coordinates are scaled along the X and Y axis.public SVGMatrix mTranslate(float x, float y)
Post-multiplies a translation transformation on the current matrix and returns the resulting current matrix.
This is equivalent to calling multiply(T), where T is an
SVGMatrix object represented by the following matrix:
[ 1 0 x ]
[ 0 1 y ]
[ 0 0 1 ]
x - the distance by which coordinates are translated in the X axis direction.y - the distance by which coordinates are translated in the Y axis direction.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2008 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.