Class Animation

java.lang.Object
ucar.visad.display.Displayable
ucar.visad.display.Animation

public class Animation extends Displayable
Provides support for a Displayable that needs a map to Display.Animation
Version:
$Revision: 1.75 $
Author:
IDV development Team
  • Field Details

  • Constructor Details

  • Method Details

    • setAnimationRealType

      public void setAnimationRealType(RealType realType) throws RemoteException, VisADException
      Sets the RealType of the VisAD Animation parameter, such as RealType.Time.
      Parameters:
      realType - The RealType of the animation parameter.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • getAnimationRealType

      public RealType getAnimationRealType()
      Returns the RealType of the Animation parameter.
      Returns:
      The RealType of the Animation parameter. May be null.
    • getAniValue

      public final Real getAniValue()
      Returns the value of the "aniValue" property. Returns null if no such value exists.
      Returns:
      The value of the property or null.
    • cloneForDisplay

      public Displayable cloneForDisplay() throws RemoteException, VisADException
      Returns a clone of this instance suitable for another VisAD display. Underlying data objects are not cloned.
      Specified by:
      cloneForDisplay in class Displayable
      Returns:
      A semi-deep clone of this instance.
      Throws:
      VisADException - VisAD failure.
      RemoteException - Java RMI failure.
    • myAddDataReferences

      public final void myAddDataReferences()

      Adds the DataReferences associated with this instance to the display.

      This implementation does nothing.

      Specified by:
      myAddDataReferences in class Displayable
    • myRemoveDataReferences

      public final void myRemoveDataReferences()

      Removes the DataReferences associated with this instance from the display.

      This implementation does nothing.

      Specified by:
      myRemoveDataReferences in class Displayable
    • setAnimationInfo

      public void setAnimationInfo(AnimationInfo ai) throws RemoteException, VisADException
      Explicitly sets the animation parameters of this instance. The parameters are copied.
      Parameters:
      ai - The animation parameters.
      Throws:
      RemoteException - Java RMI error
      VisADException - VisADError
    • getAnimationInfo

      public AnimationInfo getAnimationInfo()
      Get the AnimationInfo associated with this Animation.
      Returns:
      the AnimationInfo
    • setAnimating

      public void setAnimating(boolean on)
      Begin animating or looping.
      Parameters:
      on - Whether or not looping should be on.
    • shouldShow

      public boolean shouldShow(Real timeValue) throws VisADException, RemoteException
      Check if the animationSet.valueToIndex of the given time value is equals to the current time step.
      Parameters:
      timeValue - The time value to check
      Returns:
      Is the time value the current one being displayed
      Throws:
      RemoteException - Java RMI Exception
      VisADException - VisAD Exception
    • isAnimating

      public boolean isAnimating()
      Indicates if looping is on.
      Returns:
      true if looping; false if not looping.
    • shouldBeAnimating

      public boolean shouldBeAnimating()
      Indicates if looping is on.
      Returns:
      true if looping; false if not looping.
    • getSet

      public Set getSet()
      Returns the set of animation time-values.
      Returns:
      The set if animation times.
    • setSet

      public void setSet(Set newSet) throws VisADException, RemoteException
      Sets the animation times for this instance to use.
      Parameters:
      newSet - New animation times.
      Throws:
      VisADException - if the set isn't 1-D or doesn't have the same RealType as the animation ScalarMap.
      RemoteException - if a Java RMI failure occurs.
    • getCurrentAnimationValue

      public Real getCurrentAnimationValue()
      Get the current animation value as a Real
      Returns:
      the value
    • getTimes

      public DateTime[] getTimes()
      Get the times as an array
      Returns:
      the times or null
    • setSet

      public void setSet(Set newSet, boolean transform) throws VisADException, RemoteException
      Sets the animation times for this instance to use.
      Parameters:
      newSet - New animation times.
      transform - true to transform
      Throws:
      VisADException - if the set isn't 1-D or doesn't have the same RealType as the animation ScalarMap.
      RemoteException - if a Java RMI failure occurs.
    • getSteps

      public long[] getSteps()
      Returns an array of the dwell times for all the steps in integer milliseconds. Returns null if no such times exist; otherwise, each time value is the delay AFTER each loop step: the first time in list is time delay AFTER the display of the first data. deprecated Use getFwdSteps
      Returns:
      Dwell delays in milliseconds or null.
    • setSteps

      public void setSteps(long[] newTimes)
      Sets an integer array in milliseconds of time delay AFTER display each loop step. deprecated Use setFwdSteps
      Parameters:
      newTimes - Dwell delays in milliseconds.
    • getFwdSteps

      public long[] getFwdSteps()
      Returns an array of the dwell times for all the steps in integer milliseconds. Returns null if no such times exist; otherwise, each time value is the delay AFTER each loop step: the first time in list is time delay AFTER the display of the first data.
      Returns:
      Dwell delays in milliseconds or null.
    • setFwdSteps

      public void setFwdSteps(long[] newTimes)
      Sets an integer array in milliseconds of time delay AFTER display each loop step.
      Parameters:
      newTimes - Dwell delays in milliseconds.
    • getBackSteps

      public long[] getBackSteps()
      Returns an array of the backward dwell times for all the steps in integer milliseconds. Returns null if no such times exist; otherwise, each time value is the delay AFTER each loop step: the first time in list is time delay AFTER the display of the first data.
      Returns:
      Dwell delays in milliseconds or null.
    • setBackSteps

      public void setBackSteps(long[] newTimes)
      Sets an integer array in milliseconds of time delay AFTER display each loop step when animating backward.
      Parameters:
      newTimes - Dwell delays in milliseconds.
    • getNumSteps

      public int getNumSteps()
      Returns the number of time steps
      Returns:
      The number of time steps
    • getCurrent

      public int getCurrent()
      Returns the origin-0 index of the current time being shown. Returns 0 if there is no such time.
      Returns:
      The index of current time or 0.
    • setAniValue

      public void setAniValue(Real newTime)
      Sets the current time being shown to the value of the Real.
      Parameters:
      newTime - Real of the newTime.
    • setCurrent

      public void setCurrent(int newIndex)
      Sets the current time being shown.
      Parameters:
      newIndex - The origin-0 index of the desired time.
    • setCurrent

      public void setCurrent(int newIndex, boolean checkUserFrames)
      Sets the current time being shown.
      Parameters:
      newIndex - The origin-0 index of the desired time.
      checkUserFrames - If true then go to the next "on" frame.
    • takeStep

      public void takeStep()
      Step one time in the current direction (foward or reverse).
    • takeStep

      public void takeStep(int direction)
      Step one time in whatever direction is specified. Remeber to keep direction same as before step was made; taking step does not mean to change direction of looping; that is done through properties.
      Parameters:
      direction - an int (0=FORWARD, 1=REVERSE)
    • setStepsOk

      public void setStepsOk(boolean[] stepsOk) throws RemoteException, VisADException
      Set the steps ok. Reset the animation.
      Parameters:
      stepsOk - What steps are ok
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • setDirection

      public void setDirection(int direction)
      Set looping direction.
      Parameters:
      direction - an int, 0 = FORWARD, 1 = REVERSE
    • takeStepForward

      public void takeStepForward()
      Step one time forward.
    • takeStepBackward

      public void takeStepBackward()
      Step one time backward.
    • reCalculateAnimationSet

      public void reCalculateAnimationSet()
      Force recalculation of animation time steps based on all data with domains mapped to this Animation's RealType.
    • equals

      public boolean equals(Object obj)
      Checks the equality of this Animation with the object in question.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object to check. Animations are equal if their AnimationControls and RealTypes are equal.
      Returns:
      true if they are equal
    • getDateTimeArray

      public static DateTime[] getDateTimeArray(Set timeSet)
      Utility to create an array of DateTime from the given time set
      Parameters:
      timeSet - The time set
      Returns:
      The array
    • setEnabled

      public void setEnabled(boolean value)
      Set the Enabled property.
      Parameters:
      value - The new value for Enabled
    • getEnabled

      public boolean getEnabled()
      Get the Enabled property.
      Returns:
      The Enabled