public abstract class RTTransition<T>
extends java.lang.Object
new MyTransition(...) { protected void apply(...) { // apply the transition object to a visualization object } }.run();Attention:
run()
method on the transition!ColorTransition
,
LinearPositionTransition
Modifier and Type | Field and Description |
---|---|
static long |
DEF_DURATION
a default duration
|
static int |
DEF_STEPS
a default step size
|
protected long |
duration
the duration of the transition
|
protected long |
frame
the duration of an animation frame meaning
frame = duration / steps; |
protected int |
steps
the number of steps the transition has which is always
>= 2 |
Constructor and Description |
---|
RTTransition(AlgorithmRTE rte)
Creates a new runtime transition to animation sequences.
|
RTTransition(AlgorithmRTE rte,
long duration,
int steps)
Creates a new runtime transition to animation sequences.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterRun()
Is invoked after the transition is ended.
|
protected abstract void |
apply(T o)
Applies the current transition object.
|
protected void |
beforeRun()
Is invoked before the transition is started.
|
void |
run()
Runs the transition.
|
protected abstract T |
runStep(int step)
Runs a step of the transition.
|
protected final long duration
protected final int steps
>= 2
protected final long frame
frame = duration / steps;
public static final long DEF_DURATION
public static final int DEF_STEPS
public RTTransition(AlgorithmRTE rte) throws java.lang.IllegalArgumentException
rte
- the runtime environment of the related algorithmjava.lang.IllegalArgumentException
- public RTTransition(AlgorithmRTE rte, long duration, int steps) throws java.lang.IllegalArgumentException
rte
- the runtime environment of the related algorithmduration
- the duration of the transition in millisecondssteps
- the step count of the transition (an animation frame is duration / steps
milliseconds long)java.lang.IllegalArgumentException
- < 2
public final void run()
protected abstract T runStep(int step)
step
- the current step (one-based)protected abstract void apply(T o)
o
- the transition objectprotected void beforeRun()
protected void afterRun()