/**
   * Construct.
   *
   * @param text The VisAD Text object to be adapted.
   * @param accessor The means for accessing the individual VisAD <code>Text</code> objects of the
   *     enclosing VisAD data object.
   * @exception BadFormException The VisAD data object cannot be adapted to a netCDF API.
   */
  protected DependentTextVar(Text text, VisADAccessor accessor) throws BadFormException {
    super(
        ((ScalarType) text.getType()).getName(),
        Character.TYPE,
        accessor.getDimensions(),
        myAttributes(),
        accessor);

    fillValue = getFillValue();
  }
Example #2
0
 /** Update the location label, subclasses can override. */
 protected void updateHeaderLabel() {
   Data d = getDisplayListData();
   if (d == null) {
     super.updateHeaderLabel();
   }
   Text text = null;
   if (d instanceof FieldImpl) {
     int index = getCurrentIndex();
     if (index >= 0) {
       try {
         text = (Text) ((FieldImpl) d).getSample(index, false);
       } catch (Exception ve) {
       }
     }
   } else {
     text = (Text) d;
   }
   if (text != null) {
     headerLabel.setText(text.toString());
   } else {
     super.updateHeaderLabel();
   }
 }