|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.Field
net.rim.device.api.ui.component.progressindicator.ActivityImageField
public class ActivityImageField
This field loops an animation that represents the progress of a task.
The animation is represented by a bitmap. The bitmap should contain all frames of the animation laid out horizontally with each frame having the same width. The total width of the bitmap should be the width of one frame times the number of frames.
Field Summary |
---|
Constructor Summary | ||
---|---|---|
ActivityImageField(Bitmap bitmap,
int numFrames,
long style)
Constructs a new ActivityImageField , initializing all aspects of the animation. |
||
ActivityImageField(Bitmap bitmap,
int numFrames,
long style,
boolean loop)
Constructs a new ActivityImageField , initializing all aspects of the animation. |
||
ActivityImageField(Bitmap bitmap,
int numFrames,
long style,
boolean loop,
int targetFramesPerSecond)
Constructs a new ActivityImageField , initializing all aspects of the animation. |
||
ActivityImageField(Bitmap bitmap,
int numFrames,
long style,
boolean loop,
int duration,
int targetFramesPerSecond)
Constructs a new ActivityImageField , initializing all aspects of the animation. |
||
ActivityImageField(Bitmap bitmap,
int numFrames,
long style,
int duration)
Constructs a new ActivityImageField , initializing all aspects of the animation. |
Method Summary | ||
---|---|---|
int |
getAnimationPropertyComponentCount(int property)
Gets the number of components that comprise the given property. |
|
void |
getAnimationValue(int property,
AnimationValue value)
Gets the current value(s) for the given property. |
|
int |
getCurrentFrame()
Returns the index of the frame that is currently being animated. |
|
int |
getNumberOfFrames()
Returns the number of frames of the animation contained within the bitmap. |
|
boolean |
isAnimating()
Returns whether or not the frame is currently animating. |
|
protected void |
layout(int width,
int height)
Lays out contents of this field. |
|
protected void |
onDisplay()
Invoked when the screen this field is on is pushed onto the display stack. |
|
protected void |
onUndisplay()
Invoked when the screen this field is on is popped off the display stack. |
|
protected void |
paint(Graphics g)
Paints the contents of the field. |
|
void |
setAnimate(boolean animate)
Turns the animation of this field on or off. |
|
void |
setAnimationValue(int property,
AnimationValue value)
Sets the current value(s) for the given property. |
|
void |
setCurrentFrameIndex(int index)
Changes the index of the current frame. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ActivityImageField(Bitmap bitmap, int numFrames, long style)
ActivityImageField
, initializing all aspects of the animation.
The bitmap must be laid out horizontally, with frames of equal width.
The total length of the bitmap must be the size of a frame times the
number of frames.
This field is set as non-focusable by default.
This field defaults to the animation being active. The field will loop the animation using a default rendering delay of 200 milliseconds.
bitmap
- The bitmap containing all frames of the animation.numFrames
- The number of frames in the animation.style
- The style bits for this field.public ActivityImageField(Bitmap bitmap, int numFrames, long style, boolean loop)
ActivityImageField
, initializing all aspects of the animation.
The bitmap must be laid out horizontally, with frames of equal width.
The total length of the bitmap must be the size of a frame times the
number of frames.
This field will be set as non-focusable by default.
This field defaults to the animation being active. The animation uses a default duration per frame of 200 milliseconds. The frame rate will default to a target of 60 frames per second.
bitmap
- The bitmap containing all frames of the animation.numFrames
- The number of frames in the animation.style
- The style bits for this field.loop
- true
to loop the animation back to the start,
false
to stop animation on the final frame.public ActivityImageField(Bitmap bitmap, int numFrames, long style, int duration)
ActivityImageField
, initializing all aspects of the animation.
The bitmap must be laid out horizontally, with frames of equal width.
The total length of the bitmap must be the size of a frame times the
number of frames.
This field will be set as non-focusable by default.
This field defaults to the animation being active. The field will loop the animation. The frame rate used will be the default, a target of 60 frames per second.
bitmap
- The bitmap containing all frames of the animation.numFrames
- The number of frames in the animation.style
- The style bits for this field.duration
- The time in milliseconds for the animation to complete.public ActivityImageField(Bitmap bitmap, int numFrames, long style, boolean loop, int targetFramesPerSecond)
ActivityImageField
, initializing all aspects of the animation.
The bitmap must be laid out horizontally, with frames of equal width.
The total length of the bitmap must be the size of a frame times the
number of frames.
This field will be set as non-focusable by default.
This field defaults to the animation being active. The default duration for each frame will be used.
bitmap
- The bitmap containing all frames of the animation.numFrames
- The number of frames in the animation.style
- The style bits for this field.loop
- true
to loop the animation back to the start,
false
to stop animation on the final frame.targetFramesPerSecond
- The preferred frame rate for the animation.public ActivityImageField(Bitmap bitmap, int numFrames, long style, boolean loop, int duration, int targetFramesPerSecond)
ActivityImageField
, initializing all aspects of the animation.
The bitmap must be laid out horizontally, with frames of equal width.
The total length of the bitmap must be the size of a frame times the
number of frames.
This field will be set as non-focusable by default.
This field defaults to the animation being active.
bitmap
- The bitmap containing all frames of the animation.numFrames
- The number of frames in the animation.style
- The style bits for this field.loop
- true
to loop the animation back to the start,
false
to stop animation on the final frame.duration
- The time in milliseconds for the animation to complete.targetFramesPerSecond
- The preferred frame rate for the animation.Method Detail |
---|
public int getAnimationPropertyComponentCount(int property)
The implementer must define the component size for every animatable property defined for the Animatable
.
getAnimationPropertyComponentCount
in interface Animatable
property
- The property to retrieve the component count for.
IllegalArgumentException
- if the property is not defined on the Animatable
.public void getAnimationValue(int property, AnimationValue value)
Used by the Animation engine to obtain the current value(s) for the given target property on the Animatable
.
The implementer must set the current value(s) of the given target property in the value
parameter.
getAnimationValue
in interface Animatable
property
- The property to get the current value(s) of.value
- The AnimationValue
to set the current value(s) for the given property.
IllegalArgumentException
- if the property is not defined on the Animatable
.AnimationValue
public int getCurrentFrame()
public int getNumberOfFrames()
public boolean isAnimating()
true
if animating, false
otherwise.protected void layout(int width, int height)
layout
in class Field
width
- Amount of available horizontal space.height
- Amount of available vertical space.protected void onDisplay()
Sets up the field for rendering.
onDisplay
in class Field
protected void onUndisplay()
Stops the rendering.
onUndisplay
in class Field
protected void paint(Graphics g)
paint
in class Field
g
- Graphics
context for drawing in this field.public void setAnimate(boolean animate)
animate
- true
to turn animation on, false
to turn animation off.public void setAnimationValue(int property, AnimationValue value)
Used by the Animation engine to update the current value(s) of the given target property on the Animatable
with the currently calculated animation value. The implementer must update the current value(s) of the given target property
with the value(s) in the value
parameter.
setAnimationValue
in interface Animatable
property
- The property to set the current value(s) for.value
- The AnimationValue
used to hold the current value(s) for the given property.
IllegalArgumentException
- if the property is not defined on the Animatable
.AnimationValue
public void setCurrentFrameIndex(int index)
index
is less than 0, it will be set to 0.
If index
is greater or equal to the number of frames, it
will be set to the last frame.
index
- The index of the frame to render.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.