Exemplo n.º 1
0
 /**
  * Update the state of the box panel with the animation set
  *
  * @param timesArray Array of times in set
  */
 private void updateBoxPanel(DateTime[] timesArray) {
   if (boxPanel != null) {
     boxPanel.setNumTimes(timesArray.length);
     if (anime != null) {
       boxPanel.setOnIndex(anime.getCurrent());
     }
     if (propertiesDialog != null) {
       propertiesDialog.boxPanel.applyProperties(this.boxPanel);
     }
   }
 }
Exemplo n.º 2
0
  /**
   * The animation changed. Handle the change.
   *
   * @param evt The event
   */
  private void handleAnimationPropertyChange(PropertyChangeEvent evt) {
    //        System.err.println ("Handlechange:" +evt.getPropertyName());
    if (evt.getPropertyName().equals(Animation.ANI_VALUE)) {
      debug("handleAnimationPropertyChange value :" + evt.getPropertyName());
      Real eventValue = (Real) evt.getNewValue();
      // if there's nothing to do, return;
      if ((eventValue == null) || eventValue.isMissing()) {
        return;
      }

      /** The Animation associated with this widget */
      DateTime time = null;
      try {
        time = new DateTime(eventValue);
      } catch (VisADException ve) {;
      }
      final DateTime theDateTime = time;
      final int theIndex = ((anime != null) ? anime.getCurrent() : -1);
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              boolean oldValue = ignoreTimesCbxEvents;
              try {
                ignoreTimesCbxEvents = true;
                //                        synchronized (timesCbxMutex) {
                xcnt++;

                timesCbx.setSelectedItem(theDateTime);
                //                        }
                if ((boxPanel != null) && (theIndex >= 0)) {
                  boxPanel.setOnIndex(theIndex);
                }
                timesCbx.repaint();
              } finally {
                ignoreTimesCbxEvents = oldValue;
              }
            }
          });
      shareValue();
    } else if (evt.getPropertyName().equals(Animation.ANI_SET)) {
      if (ignoreAnimationSetChange) {
        return;
      }
      updateIndicatorInner((Set) evt.getNewValue(), true);
    }
  }
Exemplo n.º 3
0
 /** Share the index of the animation step. */
 protected void shareIndex() {
   doShare(SHARE_INDEX, new Integer(anime.getCurrent()));
 }