ui/src/main/java/ucar/nc2/ui/simplegeom/SimpleGeomController.java
private boolean setField(Object fld) {
    GridDatatype gg = null;
    if (fld instanceof GridDatatype)
      gg = (GridDatatype) fld;
    else if (fld instanceof String)
      gg = gridDataset.findGridDatatype( (String) fld);
    if (null == gg)
      return false;

    renderGrid.setGeoGrid(gg);
    currentField = gg;

    GridCoordSystem gcs = gg.getCoordinateSystem();
    gcs.setProjectionBoundingBox();

    // set levels
    CoordinateAxis1D vaxis = gcs.getVerticalAxis();
    levelNames = (vaxis == null) ? new ArrayList() : vaxis.getNames();
    if ((levelNames == null) || (currentLevel >= levelNames.size()))
      currentLevel = 0;
    vertPanel.setCoordSys(currentField.getCoordinateSystem(), currentLevel);

    // set times
    if (gcs.hasTimeAxis()) {
      CoordinateAxis1DTime taxis = gcs.hasTimeAxis1D() ? gcs.getTimeAxis1D() : gcs.getTimeAxisForRun(0);
      timeNames = (taxis == null) ? new ArrayList() : taxis.getNames();
      if ((timeNames == null) || (currentTime >= timeNames.size()))
        currentTime = 0;
      hasDependentTimeAxis = !gcs.hasTimeAxis1D();
    } else
      hasDependentTimeAxis = false;

    // set ensembles
    CoordinateAxis1D eaxis = gcs.getEnsembleAxis();
    ensembleNames = (eaxis == null) ? new ArrayList() : eaxis.getNames();
    currentEnsemble = ensembleNames.size() > 0 ? 0 : -1;

    // set runtimes
    CoordinateAxis1DTime rtaxis = gcs.getRunTimeAxis();
    runtimeNames = (rtaxis == null) ? new ArrayList() : rtaxis.getNames();
    currentRunTime = runtimeNames.size() > 0 ? 0 : -1;

    ui.setField(gg);
    return true;
  }
private boolean setField(Object fld) {
    GridDatatype gg = null;
    if (fld instanceof GridDatatype)
      gg = (GridDatatype) fld;
    else if (fld instanceof String)
      gg = gridDataset.findGridDatatype( (String) fld);
    if (null == gg)
      return false;

    renderGrid.setGeoGrid(gg);
    currentField = gg;

    GridCoordSystem gcs = gg.getCoordinateSystem();
    gcs.setProjectionBoundingBox();

    // set levels
    CoordinateAxis1D vaxis = gcs.getVerticalAxis();
    levelNames = (vaxis == null) ? new ArrayList() : vaxis.getNames();
    if ((levelNames == null) || (currentLevel >= levelNames.size()))
      currentLevel = 0;
    vertPanel.setCoordSys(currentField.getCoordinateSystem(), currentLevel);

    // set times
    if (gcs.hasTimeAxis()) {
      CoordinateAxis1DTime taxis = gcs.hasTimeAxis1D() ? gcs.getTimeAxis1D() : gcs.getTimeAxisForRun(0);
      timeNames = (taxis == null) ? new ArrayList() : taxis.getNames();
      if ((timeNames == null) || (currentTime >= timeNames.size()))
        currentTime = 0;
      hasDependentTimeAxis = !gcs.hasTimeAxis1D();
    } else
      hasDependentTimeAxis = false;

    // set ensembles
    CoordinateAxis1D eaxis = gcs.getEnsembleAxis();
    ensembleNames = (eaxis == null) ? new ArrayList() : eaxis.getNames();
    currentEnsemble = ensembleNames.size() > 0 ? 0 : -1;

    // set runtimes
    CoordinateAxis1DTime rtaxis = gcs.getRunTimeAxis();
    runtimeNames = (rtaxis == null) ? new ArrayList() : rtaxis.getNames();
    currentRunTime = runtimeNames.size() > 0 ? 0 : -1;

    ui.setField(gg);
    return true;
  }
private boolean setField ( Object fld ) { GridDatatype gg = null ; if ( fld instanceof GridDatatype ) gg = ( GridDatatype ) fld ; else if ( fld instanceof String ) gg = gridDataset . findGridDatatype ( ( String ) fld ) ; if ( null == gg ) return false ; renderGrid . setGeoGrid ( gg ) ; currentField = gg ; GridCoordSystem gcs = gg . getCoordinateSystem ( ) ; gcs . setProjectionBoundingBox ( ) ; // set levels
 CoordinateAxis1D vaxis = gcs . getVerticalAxis ( ) ; levelNames = ( vaxis == null ) ? new ArrayList ( ) : vaxis . getNames ( ) ; if ( ( levelNames == null ) || ( currentLevel >= levelNames . size ( ) ) ) currentLevel = 0 ; vertPanel . setCoordSys ( currentField . getCoordinateSystem ( ) , currentLevel ) ; // set times
 if ( gcs . hasTimeAxis ( ) ) { CoordinateAxis1DTime taxis = gcs . hasTimeAxis1D ( ) ? gcs . getTimeAxis1D ( ) : gcs . getTimeAxisForRun ( 0 ) ; timeNames = ( taxis == null ) ? new ArrayList ( ) : taxis . getNames ( ) ; if ( ( timeNames == null ) || ( currentTime >= timeNames . size ( ) ) ) currentTime = 0 ; hasDependentTimeAxis = ! gcs . hasTimeAxis1D ( ) ; } else hasDependentTimeAxis = false ; // set ensembles
 CoordinateAxis1D eaxis = gcs . getEnsembleAxis ( ) ; ensembleNames = ( eaxis == null ) ? new ArrayList ( ) : eaxis . getNames ( ) ; currentEnsemble = ensembleNames . size ( ) > 0 ? 0 : - 1 ; // set runtimes
 CoordinateAxis1DTime rtaxis = gcs . getRunTimeAxis ( ) ; runtimeNames = ( rtaxis == null ) ? new ArrayList ( ) : rtaxis . getNames ( ) ; currentRunTime = runtimeNames . size ( ) > 0 ? 0 : - 1 ; ui . setField ( gg ) ; return true ; }
public GridDatatype getField() { return currentField; }
public GridDatatype getField () { return currentField ; }