Package nl.tue.id.oocsi
Class Animator
java.lang.Object
nl.tue.id.oocsi.Animator
public class Animator
extends java.lang.Object
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description void
addRandomStep(long delayMin, long delayMax, float valueMin, float valueMax)
add an animation step with random delay in milliseconds betweendelayMin
anddelayMax
.void
addRandomStep(long delayMin, long delayMax, float valueMin, float valueMax, java.lang.String name)
add an animation step with random delay in milliseconds betweendelayMin
anddelayMax
.<K> void
addStep(long delay, K value)
add an animation step with delay in milliseconds and a value that will be sent after the delay has passed<K> void
addStep(long delay, K value, java.lang.String name)
add a named animation step with delay in milliseconds and a value that will be sent after the delay has passed.void
loop(boolean looping)
set the animation behavior to looping (true) or not (false)void
resume()
resume the animationvoid
start()
start the animator with the first stepvoid
stop()
stop the animator (will not reset the steps, so you can resume the animation later)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Animator
create an animator with an OOCSI reference, a channel name where the animation messages should be sent and a message attribute as a key for the values that are sent- Parameters:
oocsi
-channel
-attribute
-
-
-
Method Details
-
start
public void start()start the animator with the first step -
stop
public void stop()stop the animator (will not reset the steps, so you can resume the animation later) -
resume
public void resume()resume the animation -
loop
public void loop(boolean looping)set the animation behavior to looping (true) or not (false)- Parameters:
looping
-
-
addStep
public <K> void addStep(long delay, K value)add an animation step with delay in milliseconds and a value that will be sent after the delay has passed- Parameters:
delay
-value
-
-
addStep
public <K> void addStep(long delay, K value, java.lang.String name)add a named animation step with delay in milliseconds and a value that will be sent after the delay has passed. the name will be sent as well- Parameters:
delay
-value
-name
-
-
addRandomStep
public void addRandomStep(long delayMin, long delayMax, float valueMin, float valueMax)add an animation step with random delay in milliseconds betweendelayMin
anddelayMax
. a random value betweenvalueMin
andvalueMax
will be sent after the delay has passed- Parameters:
delayMin
-delayMax
-valueMin
-valueMax
-
-
addRandomStep
public void addRandomStep(long delayMin, long delayMax, float valueMin, float valueMax, java.lang.String name)add an animation step with random delay in milliseconds betweendelayMin
anddelayMax
. a random value betweenvalueMin
andvalueMax
will be sent after the delay has passed. the name will be sent as well.- Parameters:
delayMin
-delayMax
-valueMin
-valueMax
-name
-
-