Class Animator

java.lang.Object
nl.tue.id.oocsi.Animator

public class Animator
extends java.lang.Object
  • Constructor Summary

    Constructors
    Constructor Description
    Animator​(OOCSI oocsi, java.lang.String channel, java.lang.String attribute)
    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
  • 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 between delayMin and delayMax.
    void addRandomStep​(long delayMin, long delayMax, float valueMin, float valueMax, java.lang.String name)
    add an animation step with random delay in milliseconds between delayMin and delayMax.
    <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 animation
    void start()
    start the animator with the first step
    void 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

      public Animator​(OOCSI oocsi, java.lang.String channel, java.lang.String attribute)
      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 between delayMin and delayMax. a random value between valueMin and valueMax 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 between delayMin and delayMax. a random value between valueMin and valueMax will be sent after the delay has passed. the name will be sent as well.
      Parameters:
      delayMin -
      delayMax -
      valueMin -
      valueMax -
      name -