Beispiel #1
0
 /**
  * Get the time at the given index. May return null.
  *
  * @param index Index
  * @return Time
  */
 public DateTime getTimeAtIndex(int index) {
   if (anime == null) {
     return null;
   }
   if (timesArray == null) {
     timesArray = Animation.getDateTimeArray(anime.getSet());
   }
   if ((timesArray == null) || (index < 0) || (index >= timesArray.length)) {
     return null;
   }
   return timesArray[index];
 }
Beispiel #2
0
  /** Go to the end of the animation sequence. */
  public void gotoEnd() {
    if (anime != null) {
      visad.Set aset = anime.getSet();
      if (aset != null) {
        try {
          anime.setCurrent(aset.getLength() - 1);
        } catch (VisADException ve) {;
        }
      }
    }

    setRunning(false);
    // shareIndex ();
    shareValue();
  }
Beispiel #3
0
 /**
  * Sets the <CODE>ucar.visad.display.Animation</CODE> controlled by this widget. Removes any other
  * <CODE>ucar.visad.display.Animation</CODE> from the control of this widget.
  *
  * @param newAnimation ucar.visad.display.Animation to control
  */
 public void setAnimation(Animation newAnimation) {
   if (newAnimation == null) {
     throw new NullPointerException("Animation can't be null");
   }
   removeAnimationListener();
   anime = newAnimation;
   animationInfo.set(anime.getAnimationInfo());
   updateIndicator(anime.getSet());
   animationListener =
       new PropertyChangeListener() {
         public void propertyChange(PropertyChangeEvent evt) {
           handleAnimationPropertyChange(evt);
         }
       };
   anime.addPropertyChangeListener(animationListener);
 }
Beispiel #4
0
 /**
  * Set the times that should be used. If this is set we don't go to the displaymaster to get the
  * times.
  *
  * @param times List of times
  * @throws RemoteException On badness
  * @throws VisADException On badness
  */
 public void setBaseTimes(Set times) throws VisADException, RemoteException {
   getAnimationSetInfo().setBaseTimes(times);
   if (times != null) {
     if (anime != null) {
       if (getAnimationSetInfo().getActive()) {
         Set newSet = getAnimationSetInfo().makeTimeSet(null);
         anime.setSet(newSet);
       } else {
         anime.setSet(times);
       }
       updateIndicator(anime.getSet());
     }
   } else {
     updateIndicator(null);
   }
 }