|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpivot.wtk.effects.Transition
public abstract class Transition
Abstract base class for "transitions", which are animated application effects.
Field Summary | |
---|---|
static int |
DEFAULT_DURATION
|
static int |
DEFAULT_RATE
|
Constructor Summary | |
---|---|
Transition()
Creates a new, non-repeating transition with the default duration and rate. |
|
Transition(int duration,
int rate,
boolean repeat)
Creates a new transition with the given duration, rate, and repeat. |
Method Summary | |
---|---|
void |
end()
"Fast-forwards" to the end of the transition and fires a TransitionListener.transitionCompleted(Transition) event. |
long |
getCurrentTime()
Returns the last time the transition was updated. |
int |
getDuration()
Returns the transition duration. |
int |
getElapsedTime()
Returns the elapsed time since the transition started. |
int |
getInterval()
Returns the transition interval, the number of milliseconds between updates. |
float |
getPercentComplete()
Returns the percentage of the transition that has completed. |
int |
getRate()
Returns the transition rate. |
long |
getStartTime()
Returns the time at which the transition was started. |
boolean |
isRunning()
Tells whether or not the transition is currently running. |
void |
setDuration(int duration)
Sets the transition duration, the length of time the transition is scheduled to run. |
void |
setRate(int rate)
Sets the transition rate, the number of times the transition will be updated within the span of one second. |
void |
start()
Starts the transition. |
void |
start(TransitionListener transitionListener)
Starts the transition. |
void |
stop()
Stops the transition. |
protected abstract void |
update()
Called repeatedly while the transition is running to update the transition's state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_DURATION
public static final int DEFAULT_RATE
Constructor Detail |
---|
public Transition()
public Transition(int duration, int rate, boolean repeat)
duration
- Transition duration, in milliseconds.rate
- Transition rate, in frames per second.Method Detail |
---|
public int getDuration()
setDuration(int)
public void setDuration(int duration)
duration
- The duration of the transition, in milliseconds.public int getRate()
setRate(int)
public void setRate(int rate)
rate
- The transition rate, in frames per second.public int getInterval()
public long getStartTime()
public long getCurrentTime()
public int getElapsedTime()
public float getPercentComplete()
public boolean isRunning()
public final void start()
update()
to establish the
initial state and starts a timer that will repeatedly call
update()
at the current rate.
public void start(TransitionListener transitionListener)
update()
to establish the
initial state and starts a timer that will repeatedly call
update()
at the current rate. The specified
TransitionListener will be notified when the transition
completes.
transitionListener
- The listener to get notified when the transition completes, or
null if no notification is necessarypublic void stop()
TransitionListener.transitionCompleted(Transition)
event.
public void end()
TransitionListener.transitionCompleted(Transition)
event.
protected abstract void update()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |