|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.dtv.ui.AnimatedMatte
public class AnimatedMatte
This class represents an animated matte with a dynamic image mask, where the pixel values determine the matte transparency for every pixel for a certain point of time.
Matte
Field Summary |
---|
Fields inherited from interface com.sun.dtv.ui.Animated |
---|
ALTERNATING, LOOP, REPEATING |
Constructor Summary | |
---|---|
AnimatedMatte()
|
Method Summary | |
---|---|
boolean |
animate()
Allows the animation to reduce "repaint" calls when it returns false. |
int |
getAnimationMode()
Obtains the animation mode for the matte's animation. |
int |
getDelay()
Obtains the delay after every image for the matte's animation when running. |
Image[] |
getImageOpacity()
Gets the opacity value images for this matte, if an image animation has been previously assigned to this matte, null otherwise. |
Dimension |
getOffset(int index)
Obtains the offset the image matte has relatively to the top left corner of the component's area for a certain position within the animation. |
float[] |
getOpacity()
Gets the opacity values for the animation of this matte, if a row of unitary opacity values is assigned to this matte at the moment, otherwise null. |
int[] |
getOpacityAsInts()
Gets the opacity values for the animation of this matte, if a row of unitary opacity values is assigned to this matte at the moment, otherwise null. |
int |
getPosition()
Obtains the current position the matte's animation is at the point of time of the method call. |
int |
getRepetitionMode()
Returns the repetition mode of the matte's animation in form of a number. |
boolean |
hasImageAnimation()
Obtains whether the currently assigned animation to this matte is based on a row of images or not. |
boolean |
isRunning()
Obtains the running mode of the matte's animation. |
void |
jumpTo(int index)
Forces the matte's animation to jump to the position indicated by the parameter. |
void |
paint(Graphics g)
Draws the animation, within a component the standard paint method would be invoked since it bares the exact same signature. |
void |
setAnimationMode(int mode)
Sets the animation mode for the matte's animation. |
void |
setDelay(int delay)
Determines the delay after every image when running the matte's animation. |
void |
setOffset(int index,
Dimension dimension)
Determines the offset for the opacity image to be assigned with this matte for a certain position in the animation. |
void |
setOpacity(float[] opacities)
Sets opacity values for this matte, causing an animation of changing opacity, while the opacity at a certain point of time is unitary for all pixels. |
void |
setOpacity(Image[] images)
Sets the opacity of the matte to a row of images causing an animation of changing opacity images. |
void |
setOpacity(int[] opacities)
Sets opacity values for this matte, causing an animation of changing opacity, while the opacity at a certain point of time is unitary for all pixels. |
void |
setRepetitionMode(int repetitions)
Determines how often the matte's animation is repeated once it has been started. |
void |
start()
Starts the matte's animation. |
void |
stop()
Stops the matte's animation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnimatedMatte()
Method Detail |
---|
public void setOpacity(int[] opacities)
setOpacity(float[])
, where an integer value
i
in the array passed to this method has the same effect as
a float value (float)(i/255)
at the same position in the
array passed to setOpacity(float[])
.
opacities
- the values for the changing opacity during the
animation of this matte. The array elements should be integer
values between 0 and 255, where 0 stands for full transparency, and 255
for full opacity. Values below 0 will be interpreted as 0 (fully
transparent), values greater 255 as 255 (fully opaque). If the parameter
is null
, previously opacity values are removed.
IllegalArgumentException
- if the length of the opacity array
is 0.getOpacityAsInts()
public void setOpacity(float[] opacities)
setOpacity(int[])
, where a floating point
value f
in the array passed to this method has the same
effect as an integer value (int)(f * 255)
at the same
position in the array passed to setOpacity(int[])
.
opacities
- the values for the changing opacity during the
animation of this matte. The array elements should be a floating point
values between 0.0f and 1.0f, where 0.0f stands for full
transparency, and 1.0f for full opacity. Values below 0.0f will be
interpreted as 0.0f (fully transparent), values greater 1.0f as 1.0f
(fully opaque). If the parameter is null
, previously
opacity values are removed.
IllegalArgumentException
- if the length of the opacity array
is 0.getOpacity()
public void setOpacity(Image[] images)
StaticMatte
with opacity 1.0. By default the images matte is aligned with the top
left corner of the components area. This can be changed (for any image
separately) using the setOffset()
method.
A call to this method overwrites a previously set animation of images
or unitary opacity values.
images
- the values for the opacity, which have to be an array of
images, containing pixel values between 0.0 and 1.0. 0.0 stands for
full transparency, and 1.0 for full opacity. Values below 0.0 will be
interpreted as 0.0 (fully transparent), values greater 1.0 as 1.0
(fully opaque). Note that if an image is not available while the
animation is running (because the array element is null or the image
is still loading) this image will be skipped.getOpacity()
public float[] getOpacity()
setOpacity(float[])
public int[] getOpacityAsInts()
setOpacity(int[])
public Image[] getImageOpacity()
setOpacity(com.sun.dtv.lwuit.Image[])
public void setOffset(int index, Dimension dimension)
index
- index of the content image array for which the offset
should be setdimension
- a Dimension object determining the offset toward the
top left corner of the component's area. if the parameter is
null
, no offset will be determined, and a previously
assigned offset will be removed.getOffset(int)
public Dimension getOffset(int index)
null
is returned.
index
- index of the animation position the offset value should be
obtained for
Dimension
object or null (in this case there is no
offset for this animation position, or the currently valid animation
is based on unitary opacity values)setOffset(int, com.sun.dtv.lwuit.geom.Dimension)
public void start()
start()
causes a restart of the animation.
start
in interface Animated
public void stop()
stop()
has no effect.
stop
in interface Animated
public boolean isRunning()
isRunning
in interface Animated
public void jumpTo(int index)
jumpTo
in interface Animated
index
- the index in the row of images building the animation to
which the animation is forced to jumppublic int getPosition()
getPosition
in interface Animated
public void setRepetitionMode(int repetitions)
setRepetitionMode
in interface Animated
repetitions
- number of repetitions to be determined. This can be
any number larger than zero or LOOP
alternatively. LOOP means that the animation runs in an endless loop
until the stop()
method has been
called.getRepetitionMode()
public int getRepetitionMode()
getRepetitionMode
in interface Animated
LOOP
which means the animation runs in an
endless loop until the stop()
method has been called.setRepetitionMode(int)
public void setDelay(int delay)
setDelay
in interface Animated
delay
- delay in millisecondsgetDelay()
public int getDelay()
getDelay
in interface Animated
setDelay(int)
public void setAnimationMode(int mode)
setAnimationMode
in interface Animated
mode
- the animation mode. Possible values are: REPEATING
and ALTERNATING
.getAnimationMode()
public int getAnimationMode()
getAnimationMode
in interface Animated
REPEATING
and ALTERNATING
.setAnimationMode(int)
public boolean hasImageAnimation()
true
is current animation is based on a row of
opacity images, false
if it is based on a row of unitary
opacity valuespublic boolean animate()
Animation
animate
in interface Animation
public void paint(Graphics g)
paint
in interface Animation
|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |