public abstract class Transformation<T extends Transformation<T,S>,S extends ITransformable>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected long |
delay
Delay of this
Transformation in ticks. |
protected long |
duration
Duration of this
Transformation in ticks. |
protected long |
elapsedTimeCurrentLoop
Amount of time passed wihtin current loop.
|
static int |
LINEAR |
protected long |
loopResetDelay
Delay between loops.
|
protected int |
loops
Number of loops to do. -1 for infinite.
|
protected long |
loopStartDelay
Delay between loops.
|
protected int |
movement
Type of movement.
|
protected boolean |
reversed
Whether this
Transformation is in reversed.. |
static int |
SINUSOIDAL |
| Constructor and Description |
|---|
Transformation() |
| Modifier and Type | Method and Description |
|---|---|
protected float |
completion(long elapsedTime)
Calculates the completion of this
Transformation based on the movement and the elapsed time. |
T |
delay(int delay)
Sets the delay for this
Transformation. |
protected abstract void |
doTransform(S transformable,
float comp)
Calculates the transformation.
|
T |
forTicks(int duration)
Sets the duration for this
Transformation. |
T |
forTicks(int duration,
int delay)
Sets the duration and delay for this
Transformation. |
long |
getDelay()
Gets the delay of this
Transformation |
long |
getDuration()
Gets the duration of this
Transformation |
long |
getLoopDuration()
Gets the duration of one loop of this
Transformation |
int |
getLoops()
Gets the number of loops of this
Transformation |
T |
loop(int loops)
Sets the number of loop for this
Transformation. |
T |
loop(int loops,
int startDelay,
int resetDelay)
Sets the number of loops, with the specified delays for this
Transformation. |
T |
movement(int movement)
Sets the movement for this
Transformation. |
T |
reversed(boolean reversed)
Sets this
Transformation to be reversed. |
abstract T |
self()
Gets this
Transformation. |
long |
totalDuration()
Gets the total duration of this
Transformation. |
void |
transform(java.util.List<S> transformables,
long elapsedTime)
Applies this
Transformation to the ITransformable. |
void |
transform(S transformable,
long elapsedTime)
Applies this
Transformation to the ITransformable |
public static final int LINEAR
public static final int SINUSOIDAL
protected int movement
protected long duration
Transformation in ticks.protected long delay
Transformation in ticks.protected int loops
protected long loopStartDelay
protected long loopResetDelay
protected long elapsedTimeCurrentLoop
protected boolean reversed
Transformation is in reversed..public T movement(int movement)
Transformation.movement - the movementpublic T delay(int delay)
Transformation.delay - the delaypublic T forTicks(int duration)
Transformation.duration - the durationpublic T forTicks(int duration, int delay)
Transformation.duration - the durationdelay - the delaypublic long getDuration()
Transformationpublic long getDelay()
Transformationpublic int getLoops()
Transformationpublic long totalDuration()
Transformation.public long getLoopDuration()
Transformationpublic T loop(int loops)
Transformation.loops - the loopspublic T loop(int loops, int startDelay, int resetDelay)
Transformation.loops - the loopsstartDelay - the start delayresetDelay - the reset delaypublic T reversed(boolean reversed)
Transformation to be reversed.reversed - the reversedpublic void transform(java.util.List<S> transformables, long elapsedTime)
Transformation to the ITransformable.transformables - the transformableselapsedTime - the elapsed timepublic void transform(S transformable, long elapsedTime)
Transformation to the ITransformabletransformable - the transformableelapsedTime - the elapsed timeprotected float completion(long elapsedTime)
Transformation based on the movement and the elapsed time.elapsedTime - the elapsed timepublic abstract T self()
Transformation.protected abstract void doTransform(S transformable, float comp)
transformable - the transformablecomp - the comp