|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.effects.Transition
public abstract class Transition
Abstract base class for "transitions", which are animated application effects.
Constructor Summary | |
---|---|
Transition(int duration,
int rate)
Creates a new non-repeating transition with the given duration, rate. |
|
Transition(int duration,
int rate,
boolean repeating)
Creates a new transition with the given duration, rate, and repeat. |
|
Transition(int duration,
int rate,
boolean repeating,
boolean reversed)
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 |
isRepeating()
|
boolean |
isReversed()
Tests whether the transition is reversed. |
boolean |
isRunning()
Tells whether or not the transition is currently running. |
void |
reverse()
Reverses the transition. |
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 |
setReversed(boolean reversed)
Sets the transition's reversed flag. |
void |
start()
Starts the transition with no listener. |
void |
start(TransitionListener transitionListenerArgument)
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 |
Constructor Detail |
---|
public Transition(int duration, int rate)
duration
- Transition duration, in milliseconds.rate
- Transition rate, in frames per second.public Transition(int duration, int rate, boolean repeating)
duration
- Transition duration, in milliseconds.rate
- Transition rate, in frames per second.repeating
- true if the transition should repeat; false, otherwise.public Transition(int duration, int rate, boolean repeating, boolean reversed)
duration
- Transition duration, in milliseconds.rate
- Transition rate, in frames per second.repeating
- true if the transition should repeat; false, otherwise.reversed
- true if the transition should run in reverse; false
otherwise.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()
start(TransitionListener)
public void start(TransitionListener transitionListenerArgument)
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.
transitionListenerArgument
- 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()
public boolean isRepeating()
public boolean isReversed()
public void setReversed(boolean reversed)
reversed
- public void reverse()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |