/** * Sets the set of times of all the profiles. The set will contain one or more times as double * values, in order, from earliest to latest. * * @param times The times of all the profiles. * @param source * @throws VisADException if a VisAD failure occurs. * @throws RemoteException if a Java RMI failure occurs. */ public void setTimes(SampledSet times, SoundingDataNode source) throws VisADException, RemoteException { RealType timeType = (RealType) ((SetType) times.getType()).getDomain().getComponent(0); // use a LineDrawing because it's the simplest DisplayableData if (timesHolder == null) { timesHolder = new LineDrawing("times ref"); } /* * Add a data object to the display that has the right * time-centers. */ Field dummy = new FieldImpl(new FunctionType(timeType, AirTemperatureProfile.instance()), times); for (int i = 0, n = times.getLength(); i < n; i++) { dummy.setSample(i, AirTemperatureProfile.instance().missingData()); } timesHolder.setData(dummy); if (widget == null) { if (times.getLength() == 1) { DateTime time = new DateTime( new Real( timeType, times.indexToDouble(new int[] {0})[0][0], times.getSetUnits()[0])); widget = GuiUtils.wrap(new JLabel(time.toString())); dataNode.setTime(time); setSounding(0); } else { // // Set the animation. // Animation animation = getInternalAnimation(timeType); getSoundingView().setExternalAnimation(animation, getAnimationWidget()); aeroDisplay.addDisplayable(animation); aeroDisplay.addDisplayable(timesHolder); Container container = Box.createHorizontalBox(); // Wrap these components so they don't get stretched in the Y direction container.add(GuiUtils.wrap(getAnimationWidget().getContents(false))); // container.add(GuiUtils.wrap (animationWidget.getIndicatorComponent())); widget = container; } } }