net.rim.device.api.math
Class Transform2D

java.lang.Object
  extended by net.rim.device.api.math.Transform2D
All Implemented Interfaces:
Animatable

public class Transform2D
extends Object
implements Animatable

Defines a 2-dimensional transformation.

Note: When using the scale, shear, rotate, and translate methods, only the transform's corresponding scale, shear, rotation, or translation component is updated (it is not as if the scale, shear, rotate, or translate is applied to the transform's matrix).

For example, if the user calls t.rotate(angle), this updates t's internal rotation component by rotating it counter-clockwise by angle radians. The following code demonstrates this more clearly:

   // Create a non-identity transform and get a copy of its matrix.
   Transform2D t1 = new Transform2D(new Vector2f(1.2f, 1.7f), new Vector2f(), 0.0f, new Vector2f(10.0f, -2.0f));
   Matrix3f t2 = new Matrix3f(t1.getMatrix());

   // Rotate the transform's rotation component by 35 degrees (counter-clockwise) and get the new matrix.
   t1.rotate((float)Math.toRadians(35.0f));
   Matrix3f t1Matrix = t1.getMatrix();
   
   // Multiply t1's original matrix by a matrix representing the same rotation as above.
   Matrix3f rotate = new Matrix3f();
   Matrix3f.createRotation((float)Math.toRadians(35.0f), rotate);
   t2.multiply(rotate);
   
   // At this point, t1Matrix is not equal to t2!
   if (t1Matrix.equals(t2))
       throw new RuntimeException();
  

Note: To construct a Transform2D from a transformation matrix stored as a Matrix3f, first decompose the Matrix3f into its separate translation, scale, shear, and rotation components using Matrix3f.decompose(Vector2f, Vector2f, Matrix3f, Vector2f) and then pass those arguments to the appropriate constructor or set methods of Transform2D.

See Also:
Matrix3f.decompose(Vector2f, Vector2f, Matrix3f, Vector2f)
Since:
BlackBerry API 6.0.0

Field Summary
static int ANIMATION_PROPERTY_ROTATE
          Used to animate the rotation component.
static int ANIMATION_PROPERTY_SCALE
          Used to animate the scale component.
static int ANIMATION_PROPERTY_SHEAR
          Used to animate the shear component.
static int ANIMATION_PROPERTY_TRANSFORM
          Used to animate the all components.
static int ANIMATION_PROPERTY_TRANSLATE
          Used to animate the translation component.
static int ANIMATION_PROPERTY_TRANSLATE_ROTATE
          Used to animate the translation-rotation component.
 
Constructor Summary
Transform2D()
          Constructs the identity transform.
Transform2D(Transform2D transform)
          Constructs a new transform from the given transform.
Transform2D(Vector2f scale, Vector2f shear, float rotation, Vector2f translation)
          Constructs a new transform from the specified values.
 
Method Summary
 boolean equals(Object obj)
          Determines if the specified object is of type Transform2D and all of its elements are equal to the elements of this transform.
 boolean equals(Transform2D transform)
          Returns true if all elements of the specified transform are equal to the elements of this transform.
 int getAnimationPropertyComponentCount(int property)
           Gets the number of components of the specified property.
 void getAnimationValue(int property, AnimationValue value)
           Gets the value or values of the specified property.
 Matrix3f getMatrix()
          Gets the matrix corresponding to this transform.
 void getMatrix(Matrix3f matrix)
          Gets the matrix corresponding to the transform in the specified matrix.
 float getRotation()
          Gets the orientation angle of this transform.
 void getScale(Vector2f scale)
          Gets the scale component of this transform in the specified vector.
 void getShear(Vector2f shear)
          Gets the shear component of this transform in the specified vector.
 void getTranslation(Vector2f translation)
          Gets the translation component of this transform in the specified vector.
 int hashCode()
          Returns a hash code based on the elements of this transform.
 void rotate(float angle)
          Rotates this transform by the given rotation defined as an angle about the origin.
 void rotate(float angle, Transform2D dst)
          Rotates this transform by the given rotation defined as an angle about the origin and stores the result in the given destination transform.
 void scale(float scale)
          Scales this transform's scale component by the given factor along all axes.
 void scale(float sx, float sy)
          Scales this transform's scale component by the given factors along each axis.
 void scale(float sx, float sy, Transform2D dst)
          Scales this transform's scale component by the given factors along each axis and stores the result in the given destination transform.
 void scale(float scale, Transform2D dst)
          Scales this transform's scale component by the given factor along all axes and stores the result in the given destination transform.
 void scale(Vector2f scale)
          Scales this transform's scale component by the given scale vector.
 void scale(Vector2f scale, Transform2D dst)
          Scales this transform's scale component by the given scale vector and stores the result in the given destination transform.
 void scaleX(float sx)
          Scales this transform's scale component by the given scale factor along the x axis.
 void scaleX(float sx, Transform2D dst)
          Scales this transform's scale component by the given scale factor along the x axis and stores the result in the given destination transform.
 void scaleY(float sy)
          Scales this transform's scale component by the given scale factor along the y axis.
 void scaleY(float sy, Transform2D dst)
          Scales this transform's scale component by the given scale factor along the y axis and stores the result in the given destination transform.
 void set(Transform2D transform)
          Sets this transform to the specified transform.
 void set(Vector2f scale, Vector2f shear, float rotation, Vector2f translation)
          Sets the transform to the specified values.
 void setAnimationValue(int property, AnimationValue value)
           Sets the value or values of the specified property.
 void setRotation(float angle)
          Sets the orientation angle of this transform to the specified values.
 void setScale(float scale)
          Sets the scale factor along all axes for this transform to the specified value.
 void setScale(float sx, float sy)
          Sets the scale component of this transform to the specified values.
 void setScale(Vector2f scale)
          Sets the scale component of this transform to the specified scale vector.
 void setShear(float shear)
          Sets the shear factor along all axes for this transform to the specified value.
 void setShear(float shx, float shy)
          Sets the shear component of this transform to the specified values.
 void setShear(Vector2f shear)
          Sets the shear component of this transform to the specified vector.
 void setTranslation(float tx, float ty)
          Sets the translation component for this transform to the specified values.
 void setTranslation(Vector2f translation)
          Sets the translation component for this transform to the specified translation vector.
 void shear(float shear)
          Shears this transform's shear component by the given shear factor along both axes.
 void shear(float shx, float shy)
          Shears this transform's shear component by the given factors along each axis.
 void shear(float shx, float shy, Transform2D dst)
          Shears this transform's shear component by the given factors along each axis and stores the result in the given destination transform.
 void shear(float shear, Transform2D dst)
          Shears this transform's shear component by the given shear factor along both axes and stores the result in the given destination transform.
 void shear(Vector2f shear)
          Shears this transform's shear component by the given shear vector.
 void shear(Vector2f shear, Transform2D dst)
          Shears this transform's shear component by the given shear vector and stores the result in the given destination transform.
 void shearX(float shx)
          Shears this transform's shear component by the given factor along the x-axis.
 void shearX(float shx, Transform2D dst)
          Shears this transform's shear component by the given factor along the x-axis and stores the result in the given destination transform.
 void shearY(float shy)
          Shears this transform's shear component by the given factor along the y-axis.
 void shearY(float shy, Transform2D dst)
          Shears this transform's shear component by the given factor along the y-axis and stores the result in the given destination transform.
 String toString()
          Returns a String representation of this transform.
 void transformPoint(Vector2f point)
          Transforms the specified point and stores the result in the original point.
 void transformPoint(Vector2f point, Vector2f dst)
          Transforms the specified point and stores the result in the specified destination point.
 void transformVector(Vector2f vector)
          Transforms the specified vector and stores the result in the original vector.
 void transformVector(Vector2f vector, Vector2f dst)
          Transforms the specified vector and stores the result in the specified destination vector.
 void translate(float tx, float ty)
          Translates this transform's translation component by the given values along each axis.
 void translate(float tx, float ty, Transform2D dst)
          Translates this transform's translation component by the given values along each axis and stores the result in the given destination transform.
 void translate(Vector2f translation)
          Translates this transform's translation component by the given translation vector.
 void translate(Vector2f translation, Transform2D dst)
          Translates this transform's translation component by the given translation vector and stores the result in the given destination transform.
 void translateX(float tx)
          Translates this transform's translation component by the given value along the x axis.
 void translateX(float tx, Transform2D dst)
          Translates this transform's translation component by the given value along the x axis and stores the result in the given destination transform.
 void translateY(float ty)
          Translates this transform's translation component by the given value along the y axis.
 void translateY(float ty, Transform2D dst)
          Translates this transform's translation component by the given value along the y axis and stores the result in the given destination transform.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 



Field Detail

ANIMATION_PROPERTY_TRANSLATE

public static final int ANIMATION_PROPERTY_TRANSLATE
Used to animate the translation component.

Required AnimationKeyframeSequence data format:

  float[] data = 
  {
      translation.x, translation.y
  }
  

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

ANIMATION_PROPERTY_ROTATE

public static final int ANIMATION_PROPERTY_ROTATE
Used to animate the rotation component.

Required AnimationKeyframeSequence data format:

  float[] data = 
  {
      (float)Math.toRadians(angleInDegrees)
  }
 

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

ANIMATION_PROPERTY_SCALE

public static final int ANIMATION_PROPERTY_SCALE
Used to animate the scale component.

Required AnimationKeyframeSequence data format:

  float[] data = 
  {
      scale.x, scale.y
  }
 

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

ANIMATION_PROPERTY_SHEAR

public static final int ANIMATION_PROPERTY_SHEAR
Used to animate the shear component.

Required AnimationKeyframeSequence data format:

  float[] data = 
  {
      shear.x, shear.y
  }
 

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

ANIMATION_PROPERTY_TRANSLATE_ROTATE

public static final int ANIMATION_PROPERTY_TRANSLATE_ROTATE
Used to animate the translation-rotation component.

Required AnimationKeyframeSequence data format:

  float[] data = 
  {
      translate.x, translate.y,
      (float)Math.toRadians(angleInDegrees),
      shear.x, shear.y,
      scale.x, scale.y
  }
 

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

ANIMATION_PROPERTY_TRANSFORM

public static final int ANIMATION_PROPERTY_TRANSFORM
Used to animate the all components.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0


Constructor Detail

Transform2D

public Transform2D()
Constructs the identity transform.

Since:
BlackBerry API 6.0.0

Transform2D

public Transform2D(Vector2f scale,
                   Vector2f shear,
                   float rotation,
                   Vector2f translation)
Constructs a new transform from the specified values.

Parameters:
scale - The scale vector.
shear - The shear vector.
rotation - The rotation angle, in radians.
translation - The translation vector.
Throws:
NullPointerException - If scale, rotation, or translation is null.
Since:
BlackBerry API 6.0.0

Transform2D

public Transform2D(Transform2D transform)
Constructs a new transform from the given transform.

Parameters:
transform - The transform to copy.
Throws:
NullPointerException - If transform is null.
Since:
BlackBerry API 6.0.0


Method Detail

getMatrix

public void getMatrix(Matrix3f matrix)
Gets the matrix corresponding to the transform in the specified matrix.

Parameters:
matrix - The matrix to store the transformation matrix in.
Throws:
NullPointerException - If matrix is null.
Since:
BlackBerry API 6.0.0

getMatrix

public Matrix3f getMatrix()
Gets the matrix corresponding to this transform.

Note: The matrix returned from this method is mathematically equivalent to this transform only as long as this transform is not changed (i.e. by calling set(), setScale(), translate(), rotate(), etc.). Once the transform has been changed, the user must call getMatrix() again to get the updated matrix. Also note that changing the matrix returned from this method does not change this transform.

Returns:
The matrix of this transform.
Since:
BlackBerry API 6.0.0

getScale

public void getScale(Vector2f scale)
Gets the scale component of this transform in the specified vector.

Parameters:
scale - The vector to store the scale in.
Throws:
NullPointerException - If scale is null.
Since:
BlackBerry API 6.0.0

getShear

public void getShear(Vector2f shear)
Gets the shear component of this transform in the specified vector.

Parameters:
shear - The vector to store the shear in.
Throws:
NullPointerException - If shear is null.
Since:
BlackBerry API 6.0.0

getRotation

public float getRotation()
Gets the orientation angle of this transform.

Parameters:
rotation - The matrix to store the rotation in.
Returns:
The rotation angle, in radians.
Since:
BlackBerry API 6.0.0

getTranslation

public void getTranslation(Vector2f translation)
Gets the translation component of this transform in the specified vector.

Parameters:
translation - The vector to store the translation in.
Throws:
NullPointerException - If translation is null.
Since:
BlackBerry API 6.0.0

rotate

public void rotate(float angle)
Rotates this transform by the given rotation defined as an angle about the origin.

Parameters:
angle - The angle to rotate by.
Since:
BlackBerry API 6.0.0

rotate

public void rotate(float angle,
                   Transform2D dst)
Rotates this transform by the given rotation defined as an angle about the origin and stores the result in the given destination transform.

Parameters:
angle - The angle to rotate by, in radians.
dst - The destination transform.
Throws:
NullPointerException - If dst is null.
Since:
BlackBerry API 6.0.0

scale

public void scale(float scale)
Scales this transform's scale component by the given factor along all axes.

Parameters:
scale - The factor to scale by.
Since:
BlackBerry API 6.0.0

scale

public void scale(float scale,
                  Transform2D dst)
Scales this transform's scale component by the given factor along all axes and stores the result in the given destination transform.

Parameters:
scale - The factor to scale by.
dst - The destination transform.
Throws:
NullPointerException - If dst is null.
Since:
BlackBerry API 6.0.0

scale

public void scale(float sx,
                  float sy)
Scales this transform's scale component by the given factors along each axis.

Parameters:
sx - The factor to scale by in the x direction.
sy - The factor to scale by in the y direction.
Since:
BlackBerry API 6.0.0

scale

public void scale(float sx,
                  float sy,
                  Transform2D dst)
Scales this transform's scale component by the given factors along each axis and stores the result in the given destination transform.

Parameters:
sx - The factor to scale by in the x direction.
sy - The factor to scale by in the y direction.
dst - The destination transform.
Throws:
NullPointerException - If dst is null.
Since:
BlackBerry API 6.0.0

scale

public void scale(Vector2f scale)
Scales this transform's scale component by the given scale vector.

Parameters:
scale - The vector to scale by.
Throws:
NullPointerException - If scale is null.
Since:
BlackBerry API 6.0.0

scale

public void scale(Vector2f scale,
                  Transform2D dst)
Scales this transform's scale component by the given scale vector and stores the result in the given destination transform.

Parameters:
scale - The vector to scale by.
dst - The destination transform.
Throws:
NullPointerException - If scale or dst is null.
Since:
BlackBerry API 6.0.0

scaleX

public void scaleX(float sx)
Scales this transform's scale component by the given scale factor along the x axis.

Parameters:
sx - The scale factor along the x axis.
Since:
BlackBerry API 6.0.0

scaleX

public void scaleX(float sx,
                   Transform2D dst)
Scales this transform's scale component by the given scale factor along the x axis and stores the result in the given destination transform.

Parameters:
sx - The scale factor along the x axis.
dst - The destination transform.
Throws:
NullPointerException - If dst is null.
Since:
BlackBerry API 6.0.0

scaleY

public void scaleY(float sy)
Scales this transform's scale component by the given scale factor along the y axis.

Parameters:
sy - The scale factor along the y axis.
Since:
BlackBerry API 6.0.0

scaleY

public void scaleY(float sy,
                   Transform2D dst)
Scales this transform's scale component by the given scale factor along the y axis and stores the result in the given destination transform.

Parameters:
sy - The scale factor along the y axis.
dst - The destination transform.
Throws:
NullPointerException - If dst is null.
Since:
BlackBerry API 6.0.0

shear

public void shear(float shear)
Shears this transform's shear component by the given shear factor along both axes.

Parameters:
shear - The factor to shear by.
Since:
BlackBerry API 6.0.0

shear

public void shear(float shear,
                  Transform2D dst)
Shears this transform's shear component by the given shear factor along both axes and stores the result in the given destination transform.

Parameters:
shear - The factor to shear by.
dst - The destination transform.
Throws:
NullPointerException - If dst is null.
Since:
BlackBerry API 6.0.0

shear

public void shear(float shx,
                  float shy)
Shears this transform's shear component by the given factors along each axis.

Parameters:
shx - The factor to shear by in the x direction.
shy - The factor to shear by in the y direction.
Since:
BlackBerry API 6.0.0

shear

public void shear(float shx,
                  float shy,
                  Transform2D dst)
Shears this transform's shear component by the given factors along each axis and stores the result in the given destination transform.

Parameters:
shx - The factor to shear by in the x direction.
shy - The factor to shear by in the y direction.
dst - The destination transform.
Throws:
NullPointerException - If dst is null.
Since:
BlackBerry API 6.0.0

shear

public void shear(Vector2f shear)
Shears this transform's shear component by the given shear vector.

Parameters:
shear - The vector to shear by.
Throws:
NullPointerException - If shear is null.
Since:
BlackBerry API 6.0.0

shear

public void shear(Vector2f shear,
                  Transform2D dst)
Shears this transform's shear component by the given shear vector and stores the result in the given destination transform.

Parameters:
shear - The vector to shear by.
dst - The destination transform.
Throws:
NullPointerException - If shear or dst is null.
Since:
BlackBerry API 6.0.0

shearX

public void shearX(float shx)
Shears this transform's shear component by the given factor along the x-axis.

Parameters:
shx - The factor to shear by.
Since:
BlackBerry API 6.0.0

shearX

public void shearX(float shx,
                   Transform2D dst)
Shears this transform's shear component by the given factor along the x-axis and stores the result in the given destination transform.

Parameters:
shx - The factor to shear by.
dst - The destination transform.
Throws:
NullPointerException - If dst is null.
Since:
BlackBerry API 6.0.0

shearY

public void shearY(float shy)
Shears this transform's shear component by the given factor along the y-axis.

Parameters:
shy - The factor to shear by.
Since:
BlackBerry API 6.0.0

shearY

public void shearY(float shy,
                   Transform2D dst)
Shears this transform's shear component by the given factor along the y-axis and stores the result in the given destination transform.

Parameters:
shy - The factor to shear by.
dst - The destination transform.
Throws:
NullPointerException - If dst is null.
Since:
BlackBerry API 6.0.0

set

public void set(Vector2f scale,
                Vector2f shear,
                float rotation,
                Vector2f translation)
Sets the transform to the specified values.

Parameters:
scale - The scale vector.
shear - The shear vector.
rotation - The angle of rotation, in radians.
translation - The translation vector.
Throws:
NullPointerException - If scale, shear, or translation is null.
Since:
BlackBerry API 6.0.0

set

public void set(Transform2D transform)
Sets this transform to the specified transform.

Parameters:
transform - The transform to set this transform to.
Throws:
NullPointerException - If transform is null.
Since:
BlackBerry API 6.0.0

setScale

public void setScale(Vector2f scale)
Sets the scale component of this transform to the specified scale vector.

Parameters:
scale - The scale vector.
Throws:
NullPointerException - If scale is null.
Since:
BlackBerry API 6.0.0

setScale

public void setScale(float sx,
                     float sy)
Sets the scale component of this transform to the specified values.

Parameters:
sx - The scale factor along the x axis.
sy - The scale factor along the y axis.
Since:
BlackBerry API 6.0.0

setScale

public void setScale(float scale)
Sets the scale factor along all axes for this transform to the specified value.

Parameters:
scale - The scale factor along all axes.
Since:
BlackBerry API 6.0.0

setShear

public void setShear(Vector2f shear)
Sets the shear component of this transform to the specified vector.

Parameters:
shear - The shear vector.
Throws:
NullPointerException - If scale is null.
Since:
BlackBerry API 6.0.0

setShear

public void setShear(float shx,
                     float shy)
Sets the shear component of this transform to the specified values.

Parameters:
sx - The shear factor along the x-axis.
sy - The shear factor along the y-axis.
Since:
BlackBerry API 6.0.0

setShear

public void setShear(float shear)
Sets the shear factor along all axes for this transform to the specified value.

Parameters:
shear - The shear factor along all axes.
Since:
BlackBerry API 6.0.0

setRotation

public void setRotation(float angle)
Sets the orientation angle of this transform to the specified values.

Parameters:
angle - The angle of rotation, in radians.
Since:
BlackBerry API 6.0.0

setTranslation

public void setTranslation(Vector2f translation)
Sets the translation component for this transform to the specified translation vector.

Parameters:
translation - The translation vector.
Throws:
NullPointerException - If translation is null.
Since:
BlackBerry API 6.0.0

setTranslation

public void setTranslation(float tx,
                           float ty)
Sets the translation component for this transform to the specified values.

Parameters:
tx - The translation amount in the x direction.
ty - The translation amount in the y direction.
Since:
BlackBerry API 6.0.0

transformPoint

public void transformPoint(Vector2f point)
Transforms the specified point and stores the result in the original point.

Parameters:
point - The point to transform.
Throws:
NullPointerException - If point is null.
Since:
BlackBerry API 6.0.0

transformPoint

public void transformPoint(Vector2f point,
                           Vector2f dst)
Transforms the specified point and stores the result in the specified destination point.

Parameters:
point - The point to transform.
dst - The point to store the result in.
Throws:
NullPointerException - If point or dst is null.
Since:
BlackBerry API 6.0.0

transformVector

public void transformVector(Vector2f vector)
Transforms the specified vector and stores the result in the original vector.

Parameters:
vector - The vector to transform.
Throws:
NullPointerException - If vector is null.
Since:
BlackBerry API 6.0.0

transformVector

public void transformVector(Vector2f vector,
                            Vector2f dst)
Transforms the specified vector and stores the result in the specified destination vector.

Parameters:
vector - The vector to transform.
dst - The vector to store the result in.
Throws:
NullPointerException - If vector or dst is null.
Since:
BlackBerry API 6.0.0

translate

public void translate(float tx,
                      float ty)
Translates this transform's translation component by the given values along each axis.

Parameters:
tx - The amount to translate along the x axis.
ty - The amount to translate along the y axis.
Since:
BlackBerry API 6.0.0

translate

public void translate(float tx,
                      float ty,
                      Transform2D dst)
Translates this transform's translation component by the given values along each axis and stores the result in the given destination transform.

Parameters:
tx - The amount to translate along the x axis.
ty - The amount to translate along the y axis.
dst - The destination transform.
Throws:
NullPointerException - If dst is null.
Since:
BlackBerry API 6.0.0

translate

public void translate(Vector2f translation)
Translates this transform's translation component by the given translation vector.

Parameters:
translation - The amount to translate.
Throws:
NullPointerException - If translation is null.
Since:
BlackBerry API 6.0.0

translate

public void translate(Vector2f translation,
                      Transform2D dst)
Translates this transform's translation component by the given translation vector and stores the result in the given destination transform.

Parameters:
translation - The amount to translate.
dst - The destination transform.
Throws:
NullPointerException - If translation or dst is null.
Since:
BlackBerry API 6.0.0

translateX

public void translateX(float tx)
Translates this transform's translation component by the given value along the x axis.

Parameters:
tx - The amount to translate along the x axis.
Since:
BlackBerry API 6.0.0

translateX

public void translateX(float tx,
                       Transform2D dst)
Translates this transform's translation component by the given value along the x axis and stores the result in the given destination transform.

Parameters:
tx - The amount to translate along the x axis.
dst - The destination transform.
Throws:
NullPointerException - If dst is null.
Since:
BlackBerry API 6.0.0

translateY

public void translateY(float ty)
Translates this transform's translation component by the given value along the y axis.

Parameters:
ty - The amount to translate along the y axis.
Since:
BlackBerry API 6.0.0

translateY

public void translateY(float ty,
                       Transform2D dst)
Translates this transform's translation component by the given value along the y axis and stores the result in the given destination transform.

Parameters:
ty - The amount to translate along the y axis.
dst - The destination transform.
Throws:
NullPointerException - If dst is null.
Since:
BlackBerry API 6.0.0

equals

public boolean equals(Object obj)
Determines if the specified object is of type Transform2D and all of its elements are equal to the elements of this transform.

Overrides:
equals in class Object
Parameters:
obj - The object to compare.
Returns:
true if this transform is equal to obj; false otherwise.
Throws:
NullPointerException - If obj is null.
See Also:
Boolean.hashCode(), Hashtable
Since:
BlackBerry API 6.0.0

equals

public boolean equals(Transform2D transform)
Returns true if all elements of the specified transform are equal to the elements of this transform.

Parameters:
transform - The transform to compare.
Returns:
true if this transform is equal to transform; false otherwise.
Throws:
NullPointerException - If transform is null.
Since:
BlackBerry API 6.0.0

hashCode

public int hashCode()
Returns a hash code based on the elements of this transform.

Overrides:
hashCode in class Object
Returns:
The hash code for this transform.
See Also:
Object.equals(java.lang.Object), Hashtable
Since:
BlackBerry API 6.0.0

toString

public String toString()
Returns a String representation of this transform. The String representation has the format (scale, rotation, translation).

Overrides:
toString in class Object
Returns:
A String representation of this transform.
Since:
BlackBerry API 6.0.0

getAnimationValue

public void getAnimationValue(int property,
                              AnimationValue value)
Description copied from interface: Animatable

Gets the value or values of the specified property.

Used by the Animation framework to get the values of the specified property on the Animatable. The implementer must set the value of the specified target property in the AnimationValue parameter.

Specified by:
getAnimationValue in interface Animatable
Parameters:
property - The property to get the current value or values of.
value - An AnimationValue used to store the returned property values.
See Also:
Animatable.getAnimationValue(int,AnimationValue)
Since:
BlackBerry API 6.0.0

setAnimationValue

public void setAnimationValue(int property,
                              AnimationValue value)
Description copied from interface: Animatable

Sets the value or values of the specified property.

Used by the Animation framework to update the value or values of the specified target property on the Animatable with the currently calculated animation value. The implementer must update the current value or values of the given target property with the values in the AnimationValue parameter.

Specified by:
setAnimationValue in interface Animatable
Parameters:
property - The property to set the current value or values of.
value - The AnimationValue used to specify the value or values to set.
See Also:
Animatable.setAnimationValue(int,AnimationValue)
Since:
BlackBerry API 6.0.0

getAnimationPropertyComponentCount

public int getAnimationPropertyComponentCount(int property)
Description copied from interface: Animatable

Gets the number of components of the specified property.

The implementer must define the component size of every animatable property defined for the Animatable.

Specified by:
getAnimationPropertyComponentCount in interface Animatable
Parameters:
property - The property to retrieve the component count for.
Returns:
The number of components comprising the specified property.
See Also:
Animatable.getAnimationPropertyComponentCount(int)
Since:
BlackBerry API 6.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal