示例#1
0
  /**
   * Set the text on the given displayable
   *
   * @param displayable The displayable
   * @param index Which one, 0 or 1
   * @param lbl The text
   * @param textType The text type
   * @throws RemoteException On badness
   * @throws VisADException On badness
   */
  private void setText(TextDisplayable displayable, int index, String lbl, TextType textType)
      throws VisADException, RemoteException {
    Text t = new Text(textType, lbl);
    Data theData = null;
    float[][] lineVals = getPointValues();
    if (lineVals.length == 3) {
      theData =
          new Tuple(
              new Data[] {
                new RealTuple(
                    RealTupleType.LatitudeLongitudeAltitude,
                    new double[] {lineVals[0][index], lineVals[1][index], lineVals[2][index]}),
                t
              });
      displayable.setData(theData);
    } else {
      /*            theData = new Tuple(new Data[] {
      new RealTuple(RealTupleType.LatitudeLongitude,
                    new double[] { lineVals[0][index],
                                   lineVals[1][index]
                                   }), t });*/

    }
  }