|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.animation.AnimationValue
public class AnimationValue
Defines an interface for an object value that gets passed to the Animatable
target during animation,
allowing the target to get or set animation values for the property that is currently being animated.
The data in this container is stored as floating point data. However, there are getInt()
and setInt()
methods available that support rounding.
public void setAnimationValue(int property, AnimationValue value) { switch(property) { case ANIMATION_PROPERTY_XY: this.x = value.getFloat(0); this.y = value.getFloat(1); break; case ANIMATION_PROPERTY_WIDTH: this.width = value.getFloat(0); break; case ANIMATION_PROPERTY_HEIGHT: this.height = value.getFloat(0); break; _propertyDirty = true; } }
public void getAnimationValue(int property, AnimationValue value) { switch(property) { case ANIMATION_PROPERTY_XY: value.setFloat(0, this.x); value.setFloat(1, this.y); break; case ANIMATION_PROPERTY_WIDTH: value.setFloat(0, this.width); break; case ANIMATION_PROPERTY_HEIGHT: value.setFloat(0, this.height); break; } }
Animatable
Method Summary | ||
---|---|---|
Buffer |
getBuffer()
Returns the data as a Buffer . |
|
int |
getChannelCount()
Gets the number of data channels. |
|
void |
getFloat(float[] value,
int offset)
Gets the value of the AnimationValue . |
|
float |
getFloat(int index)
Gets the value of the specified component as a float . |
|
void |
getFloat(int channel,
float[] value,
int offset)
Gets the value of the AnimationValue on the specified data channel. |
|
float |
getFloat(int channel,
int index)
Gets the value of the specified component on the specified data channel as a float . |
|
int |
getInt(int index)
Gets the value of the specified component as an int . |
|
int |
getInt(int channel,
int index)
Gets the value of the specified component as an int on the specified data channel. |
|
void |
getInt(int channel,
int[] value,
int offset)
Gets the value of the AnimationValue on the specified data channel. |
|
void |
getInt(int[] value,
int offset)
Gets the value of the AnimationValue . |
|
int |
getPropertyComponentCount()
Gets the property component size of the Animatable 's target property. |
|
void |
setFloat(float[] value,
int offset)
Sets the value of the AnimationValue . |
|
void |
setFloat(int index,
float value)
Sets the value of the specified component. |
|
void |
setFloat(int channel,
float[] value,
int offset)
Sets the value of the AnimationValue on the specified data channel. |
|
void |
setFloat(int channel,
int index,
float value)
Sets the value of the specified component on the specified data channel. |
|
void |
setInt(int index,
int value)
Sets the value of the specified component. |
|
void |
setInt(int channel,
int index,
int value)
Sets the value of the specified component on the specified data channel. |
|
void |
setInt(int channel,
int[] value,
int offset)
Sets the value of the AnimationValue on the specified data channel. |
|
void |
setInt(int[] value,
int offset)
Sets the value of the AnimationValue . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public int getChannelCount()
Gets the number of data channels.
AnimationKeyframeSequence
.public int getPropertyComponentCount()
Gets the property component size of the Animatable
's target property.
Animatable
's target property.public Buffer getBuffer()
Returns the data as a Buffer
.
Buffer
.public float getFloat(int index)
Gets the value of the specified component as a float
. Retrieves the value on the first data channel.
index
- The index of the component to get the value from.
IllegalArgumentException
- if index < 0
or index >=
the property component count.public float getFloat(int channel, int index)
Gets the value of the specified component on the specified data channel as a float
.
channel
- The data channel to get the value from.index
- The index of the component to get the value from..
AnimationValue
.
IllegalArgumentException
- if channel < 0
or channel >=
the channel count.
IllegalArgumentException
- if index < 0
or index >=
the property component count.public void setFloat(int index, float value)
Sets the value of the specified component. Sets the value on the first data channel.
index
- The index of the component to set the value on.value
- The value to set.
IllegalArgumentException
- if index < 0
or index >=
the property component count.public void setFloat(int channel, int index, float value)
Sets the value of the specified component on the specified data channel.
channel
- The data channel to set the data on.index
- The index of the component to set the value on.value
- The value to set in the component.
IllegalArgumentException
- if channel < 0
or channel >=
the channel count.
IllegalArgumentException
- if index < 0
or index >=
the property component count.public void getFloat(float[] value, int offset)
Gets the value of the AnimationValue
. Retrieves the value on the first data channel.
value
- The array to populate with the values of the AnimationValue
.offset
- The offset into the array to start populating at.
IllegalArgumentException
- if value
is null
.
IllegalArgumentException
- if offset < 0
.
IllegalArgumentException
- if value.length < offset +
the property component count.public void getFloat(int channel, float[] value, int offset)
Gets the value of the AnimationValue
on the specified data channel.
channel
- The data channel to get the value from.value
- The array to populate with the values of the AnimationValue
.offset
- The offset into the array to start populating at.
IllegalArgumentException
- if channel < 0
or channel >=
the channel count.
IllegalArgumentException
- if value
is null
.
IllegalArgumentException
- if offset < 0
.
IllegalArgumentException
- if value.length < offset +
the property component count.public void setFloat(float[] value, int offset)
Sets the value of the AnimationValue
. Sets the value on the first data channel.
value
- The array that contains the values to populate the AnimationValue
with.offset
- The offset into the array to start copying from.
IllegalArgumentException
- if value
is null
.
IllegalArgumentException
- if offset < 0
.
IllegalArgumentException
- if value.length < offset +
the property component count.public void setFloat(int channel, float[] value, int offset)
Sets the value of the AnimationValue
on the specified data channel.
channel
- The data channel to set the data on.value
- The array that contains the values to populate the AnimationValue
with.offset
- The offset into the array to start copying from.
IllegalArgumentException
- if channel < 0
or channel >=
the channel count.
IllegalArgumentException
- if value
is null
.
IllegalArgumentException
- if offset < 0
.
IllegalArgumentException
- if value.length < offset +
the property component count.public int getInt(int index)
Gets the value of the specified component as an int
.
index
- The index of the component to get the value from.
IllegalArgumentException
- if index < 0
or index >=
the property component count.public int getInt(int channel, int index)
Gets the value of the specified component as an int
on the specified data channel.
channel
- The data channel to get the value from.index
- The index of the component to get the value from.
IllegalArgumentException
- if channel < 0
or channel >=
the channel count.
IllegalArgumentException
- if index < 0
or index >=
the property component count.public void setInt(int index, int value)
Sets the value of the specified component.
index
- The index of the component to set the value on.value
- The value to set.
IllegalArgumentException
- if index < 0
or index >=
the property component count.public void setInt(int channel, int index, int value)
Sets the value of the specified component on the specified data channel.
channel
- The data channel to set the data on.index
- The index of the component to set the value on.value
- The value to set.
IllegalArgumentException
- if channel < 0
or channel >=
the channel count.
IllegalArgumentException
- if index < 0
or index >=
the property component count.public void getInt(int[] value, int offset)
Gets the value of the AnimationValue
.
value
- The array to populate with the values of the AnimationValue
.offset
- The offset into the array to start populating at.
IllegalArgumentException
- if value
is null
.
IllegalArgumentException
- if offset < 0
.
IllegalArgumentException
- if value.length < offset +
the property component count.public void getInt(int channel, int[] value, int offset)
Gets the value of the AnimationValue
on the specified data channel.
channel
- The data channel to get the value from.value
- The array to populate with the AnimationValue
's values.offset
- The offset into the array to start populating at.
IllegalArgumentException
- if channel < 0
or channel >=
the channel count.
IllegalArgumentException
- if value
is null
.
IllegalArgumentException
- if offset < 0
.
IllegalArgumentException
- if value.length < offset +
the property component count.public void setInt(int[] value, int offset)
Sets the value of the AnimationValue
.
value
- The array to populate the AnimationValue
's values with.offset
- The offset into the array to start copying from.
IllegalArgumentException
- if value
is null
.
IllegalArgumentException
- if offset < 0
is negative.
IllegalArgumentException
- if value.length < offset +
the property component count.public void setInt(int channel, int[] value, int offset)
Sets the value of the AnimationValue
on the specified data channel.
channel
- The data channel to set the data on.value
- The array to populate the AnimationValue
's values with.offset
- The offset into the array to start copying from.
IllegalArgumentException
- if channel < 0
or channel >=
the channel count.
IllegalArgumentException
- if value
is null
.
IllegalArgumentException
- if offset < 0
.
IllegalArgumentException
- if value.length < offset +
the property component count.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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