Beispiel #1
0
          public void propertyChange(PropertyChangeEvent event) {

            try {
              accept((ScalarMapAdapter) event.getSource(), (ScalarMap) event.getOldValue());
            } catch (Exception e) {
              System.err.println(
                  getClass().getName()
                      + ".propertyChange(): "
                      + "Couldn't handle change to ScalarMap: "
                      + e);
            }
          }
Beispiel #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);
    }
  }
Beispiel #3
0
          public void propertyChange(PropertyChangeEvent event) {

            // A ConstantMap of the adapted data has changed.
            try {
              setChanged((DataAdapter) event.getSource());
            } catch (Exception e) {
              System.err.println(
                  getClass().getName()
                      + ".propertyChange(): "
                      + "Couldn't handle change to data: "
                      + e);
            }
          }