示例#1
0
文件: GridUI.java 项目: nbald/thredds
  void setField(GridDatatype field) {
    /*int idx = fieldChooser.setSelectedByName(field.toString());
    if (idx < 0)
      fieldChooser.setSelectedByIndex(0); */
    fieldChooser.setToolTipText(field.getName());

    GridCoordSystem gcs = field.getCoordinateSystem();

    // levels
    CoordinateAxis1D axis = gcs.getVerticalAxis();
    setChooserWanted("level", axis != null);
    if (axis != null) {
      List<NamedObject> levels = axis.getNames();
      levelChooser.setCollection(levels.iterator(), true);
      NamedObject no = levels.get(controller.getCurrentLevelIndex());
      levelChooser.setSelectedByName(no.getName());
    }

    // times
    if (gcs.hasTimeAxis()) {
      axis = gcs.hasTimeAxis1D() ? gcs.getTimeAxis1D() : gcs.getTimeAxisForRun(0);
      setChooserWanted("time", axis != null);
      if (axis != null) {
        List<NamedObject> names = axis.getNames();
        timeChooser.setCollection(names.iterator(), true);
        NamedObject no = names.get(controller.getCurrentTimeIndex());
        timeChooser.setSelectedByName(no.getName());
      }
    } else {
      setChooserWanted("time", false);
    }

    axis = gcs.getEnsembleAxis();
    setChooserWanted("ensemble", axis != null);
    if (axis != null) {
      List<NamedObject> names = axis.getNames();
      ensembleChooser.setCollection(names.iterator(), true);
      NamedObject no = names.get(controller.getCurrentEnsembleIndex());
      ensembleChooser.setSelectedByName(no.getName());
    }

    axis = gcs.getRunTimeAxis();
    setChooserWanted("runtime", axis != null);
    if (axis != null) {
      List<NamedObject> names = axis.getNames();
      runtimeChooser.setCollection(names.iterator(), true);
      NamedObject no = names.get(controller.getCurrentRunTimeIndex());
      runtimeChooser.setSelectedByName(no.getName());
    }

    setChoosers();

    colorScalePanel.setUnitString(field.getUnitsString());
  }
示例#2
0
文件: GridUI.java 项目: nbald/thredds
 public void actionPerformed(ActionEvent e) {
   scbox.getLoopControl().show();
 }
示例#3
0
文件: GridUI.java 项目: nbald/thredds
 LoopControlAction(SuperComboBox cbox) {
   this.scbox = cbox;
   BAMutil.setActionProperties(this, null, cbox.getName(), false, 0, 0);
 }
示例#4
0
文件: GridUI.java 项目: nbald/thredds
 void setFields(java.util.List fields) {
   fieldChooser.setCollection(fields.iterator());
 }