示例#1
0
  /**
   * _more_
   *
   * @param soundingObs _more_
   * @return _more_
   */
  protected List<DataChoice> getTimeMatchingDataChoices(List<SoundingOb> soundingObs) {
    List<DataChoice> newChoices = new ArrayList<DataChoice>();
    List categories = new ArrayList();

    DataCategory cat = new DataCategory(DataCategory.CATEGORY_RAOBSOUNDING);
    cat.setForDisplay(false);
    categories.add(cat);

    List compCategories = new ArrayList();
    DataCategory compCat = new DataCategory("None");
    compCat.setForDisplay(false);
    compCategories.add(compCat);

    Hashtable props = Misc.newHashtable(DataChoice.PROP_ICON, "/auxdata/ui/icons/Balloon.gif");

    for (Iterator iter = soundingObs.iterator(); iter.hasNext(); ) {
      SoundingOb ob = (SoundingOb) iter.next();
      String name = ob.getLabel();
      DateTime obTime = ob.getTimestamp();
      DataSelection timeSelect = null;
      if (obTime != null) {
        ArrayList times = new ArrayList(1);
        times.add(obTime);
        timeSelect = new DataSelection(times);
      }

      DataChoice choice =
          new DirectDataChoice(this, ob, getName(), name, categories, timeSelect, props);
      newChoices.add(choice);
    }

    return newChoices;
  }
示例#2
0
  /**
   * Adds the {@link ucar.unidata.data.DataChoice}s of the current input data via {@link
   * #addDataChoice(DataChoice)}.
   */
  protected void doMakeDataChoices() {
    int i = 0;
    List soundingObs = getRDS().getSoundingObs();
    List categories = new ArrayList();

    DataCategory cat = new DataCategory(DataCategory.CATEGORY_RAOBSOUNDING);
    cat.setForDisplay(false);
    categories.add(cat);

    List compCategories = new ArrayList();
    DataCategory compCat = new DataCategory("None");
    compCat.setForDisplay(false);
    compCategories.add(compCat);

    CompositeDataChoice composite =
        new CompositeDataChoice(this, soundingObs, getName(), "RAOB Data", categories);
    Hashtable props = Misc.newHashtable(DataChoice.PROP_ICON, "/auxdata/ui/icons/Balloon.gif");

    for (Iterator iter = soundingObs.iterator(); iter.hasNext(); ) {
      SoundingOb ob = (SoundingOb) iter.next();
      String name = ob.getLabel();
      DateTime obTime = ob.getTimestamp();
      DataSelection timeSelect = null;
      if (obTime != null) {
        ArrayList times = new ArrayList(1);
        times.add(obTime);
        timeSelect = new DataSelection(times);
      }
      DataChoice choice =
          new DirectDataChoice(this, ob, composite.getName(), name, categories, timeSelect, props);
      composite.addDataChoice(choice);
    }
    addDataChoice(composite);
  }