Пример #1
0
  /**
   * Constructs the vertical profile display and control buttons
   *
   * @param dataChoice The data for this instance.
   * @return <code>true</code> if and only if this instance was correctly initialized.
   * @throws VisADException couldn't create a VisAD object needed
   * @throws RemoteException couldn't create a remote object needed
   */
  public boolean init(DataChoice dataChoice) throws VisADException, RemoteException {

    /*
     * Initialize the superclass.
     */
    if (!super.init()) {
      return false;
    }
    setSpatialLoci(gridLocs);

    if (!setData(dataChoice)) {
      return false;
    }

    /*
     * Add the listener here (as opposed to in the contructor) so we
     * don't get spurious events before we are fully initialized
     */
    probe.addPropertyChangeListener(
        SelectorDisplayable.PROPERTY_POSITION,
        new PropertyChangeListener() {

          public void propertyChange(PropertyChangeEvent evt) {
            if (getActive() && getHaveInitialized()) {
              lineProbeWasMoved();
            }
          }
        });
    probe.setPointSize(getDisplayScale());
    probe.setAutoSize(true);
    addDisplayable(probe, FLAG_COLOR);
    addDisplayable(gridLocs, FLAG_COLOR);

    dataNode = SoundingDataNode.getInstance(new Listener());

    dataNode.setData(getData(getDataInstance()));

    return true;
  }