|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.microedition.m2g.SVGAnimator
public abstract class SVGAnimator
The SVGAnimator class handles automatic rendering of updates and animations in an SVGImage to a target user interface (UI) component. The target component type depends on the Java profile this specification is implemented on, as described in the createAnimator and getTargetComponent methods documentation.
In this implementation, the target component is a View.
As the construction of a View requires a
Context , a new factory have been added with a
context parameter.
The Context may also be set in the
animatorContext global variable: all the SVGAnimators
created by a Thread will use the context set in
animatorContext.
| Field Summary | |
|---|---|
static ThreadLocal<Context> |
animatorContext
Android context management. |
| Constructor Summary | |
|---|---|
SVGAnimator()
|
|
| Method Summary | |
|---|---|
static SVGAnimator |
createAnimator(SVGImage svgImage)
Create a new SVGAnimator for the specified
SVGImage and the current Context of
the current thread. |
static SVGAnimator |
createAnimator(SVGImage svgImage,
String componentBaseClass)
Create a new SVGAnimator for the specified
SVGImage and the current Context of
the current thread. |
static SVGAnimator |
createAnimator(SVGImage svgImage,
String componentBaseClass,
Context context)
Create a new SVGAnimator for the specified
SVGImage. |
abstract Object |
getTargetComponent()
Retrieve the animator's target component. |
abstract float |
getTimeIncrement()
Get the current time increment for animation rendering. |
abstract void |
invokeAndWait(Runnable runnable)
Invoke the Runnable in the Document update thread and return only after this Runnable has finished. |
abstract void |
invokeLater(Runnable runnable)
Schedule execution of the input Runnable in the update thread at a later time. |
abstract void |
pause()
Transition this SVGAnimator to the paused state. |
abstract void |
play()
Transition this SVGAnimator to the playing state. |
abstract void |
setSVGEventListener(SVGEventListener svgEventListener)
Associate the specified SVGEventListener with this
SVGAnimator. |
abstract void |
setTimeIncrement(float timeIncrement)
Set the time increment to be used for animation rendering. |
abstract void |
stop()
Transition this SVGAnimator to the stopped state. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ThreadLocal<Context> animatorContext
Context must be set
in this field before creating a new SVGAnimator with the JSR-226
standard SVGAnimator factories. The variable is a
ThreadLocal, so a thread creating an animator must first set the
context and animators may be created for different contexts in parallel
by different threads.
| Constructor Detail |
|---|
public SVGAnimator()
| Method Detail |
|---|
public static SVGAnimator createAnimator(SVGImage svgImage)
SVGAnimator for the specified
SVGImage and the current Context of
the current thread.
createAnimator(javax.microedition.m2g.SVGImage,
java.lang.String, android.content.Context)
public static SVGAnimator createAnimator(SVGImage svgImage,
String componentBaseClass)
SVGAnimator for the specified
SVGImage and the current Context of
the current thread.
createAnimator(javax.microedition.m2g.SVGImage,
java.lang.String, android.content.Context)
public static SVGAnimator createAnimator(SVGImage svgImage,
String componentBaseClass,
Context context)
SVGAnimator for the specified
SVGImage. This implementation adds a new animator factory
that takes the target View context.
svgImage - the SVGImage to be rendered by this animator.componentBaseClass - the desired base class for the component associated with the
animator (useful only for platforms supporting multiple UI
component frameworks). When null, this is equivalent to
invoking createAnimator with the svgImage
parameter only.context - Android context for the target View
SVGAnimator instance.
NullPointerException - if svgImage or context is null.
IllegalArgumentException - if the specified componentBaseClass is not
supported by the implementation.public abstract void setSVGEventListener(SVGEventListener svgEventListener)
SVGEventListener with this
SVGAnimator.
svgEventListener - the SVGEventListener that will receive events forwarded by
this SVGAnimator. If null, events will not be
forwarded by the SVGAnimator.public abstract void setTimeIncrement(float timeIncrement)
timeIncrement - the minimal period of time, in seconds, that should elapse
between frame. Must be greater than zero.
IllegalArgumentException - if timeIncrement is less than or equal to zero.getTimeIncrement()public abstract float getTimeIncrement()
setTimeIncrement(float)public abstract void play()
SVGAnimator to the playing state. In
the playing state, both Animation and SVGImage updates cause
rendering updates. Note that in the playing state, when the document's
current time changes, the animator will seek to the new time, and
continue to play animations from this place.
IllegalStateException - if the animator is not currently in the stopped or
paused state.public abstract void pause()
SVGAnimator to the paused state. The
SVGAnimator stops advancing the document's current time
automatically (see the SVGDocument's setCurrentTime method). In
consequence, animation playback will be paused until another call to the
play method is made, at which points animations will resume
from the document's current time. SVGImage updates (through API calls)
cause a rendering update while the SVGAnimator is in the
paused state.
IllegalStateException - if the animator is not in the playing state.public abstract void stop()
SVGAnimator to the stopped state. In
this state, no rendering updates are performed.
IllegalStateException - if the animator is not in the playing or paused
state.public abstract Object getTargetComponent()
ViewcreateAnimator(javax.microedition.m2g.SVGImage)
public abstract void invokeAndWait(Runnable runnable)
throws InterruptedException
runnable - the new Runnable to invoke.
InterruptedException - if the current thread is waiting, sleeping, or otherwise
paused for a long time and another thread interrupts it.
NullPointerException - if runnable is null.
IllegalStateException - if the animator is in the stopped state.public abstract void invokeLater(Runnable runnable)
runnable - the new Runnable to execute in the Document's update thread
when time permits.
NullPointerException - if runnable is null.
IllegalStateException - if the animator is in the stopped state.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||