setRange bug

Hi,

I'm attaching a modification of SimpleAnimation that demonstrates a bug
I've found. The differences I introduced are:

1) using setRange on the axis maps
2) doing the ref.setData after showing the frame

Without the setRange calls (actually with only one, not both!), it
works.

Putting the setData before the frame stuff (with the setRange calls)
works.

With both changes, I see nothing in the display!

VisAD bug?

Also, I'm having a related problem. I have an image that is shaped like
time->((x,y)->(a)) in a 3D display. I want it at the bottom of the ZAxis
so I am adding it with a ConstantMap to ZAxis. However, when I use
setRange on the ZAxis I see no image. I can work around this one more
easily, though.

Thanks,
Doug

-- 
*----------------------------------------------------------------------*
| Doug Lindholm, Software Engineer          |  E-mail: lind@xxxxxxxx   |
| Research Applications Program             |   Phone: 303-497-8374    |
| National Center for Atmospheric Research  |                          |
| P.O. Box 3000                             |     There's no place     |
| Boulder, Colorado 80307-3000              |        like $HOME        |
*----------------------------------------------------------------------*
/*
VisAD system for interactive analysis and visualization of numerical
data.  Copyright (C) 1996 - 2002 Bill Hibbard, Curtis Rueden, Tom
Rink, Dave Glowacki, Steve Emmerson, Tom Whittaker, Don Murray, and
Tommy Jasmin.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA
*/

// import needed classes
import visad.*;
import visad.java2d.*;
import visad.data.netcdf.Plain;
import java.rmi.RemoteException;
import java.io.IOException;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class SimpleAnimate {

  // type 'java SimpleAnimate' to run this application
  public static void main(String args[])
         throws VisADException, RemoteException, IOException {

    int step = 1000;
    if (args.length > 0) {
      try {
        step = Integer.parseInt(args[0]);
      }
      catch(NumberFormatException e) {
        step = 1000;
      }
    }
    if (step < 1) step = 1;

    // create a netCDF reader
    Plain plain = new Plain();

    // open a netCDF file containing an image sequence and adapt
    // it to a Field Data object
    Field image_sequence = null;
    try {
      image_sequence = (Field) plain.open("images.nc");
    }
    catch (IOException exc) {
      String s = "To run this example, the images.nc file must be "
        +"present in\nyour visad/examples directory."
        +"You can obtain this file from:\n"
        +"  ftp://www.ssec.wisc.edu/pub/visad-2.0/images.nc.Z";;
      System.out.println(s);
      System.exit(0);
    }

    // create a Display using Java2D
    DisplayImpl display = new DisplayImplJ2D("image display");

    // extract the type of image and use
    // it to determine how images are displayed
    FunctionType image_sequence_type
      (FunctionType) image_sequence.getType();
    FunctionType image_type
      (FunctionType) image_sequence_type.getRange();
    RealTupleType domain_type = image_type.getDomain();

    // map image coordinates to display coordinates
    ScalarMap xsm = new ScalarMap((RealType) domain_type.getComponent(0),
                                 Display.XAxis);
    xsm.setRange( -100.0, 300.0 );
    ScalarMap ysm = new ScalarMap((RealType) domain_type.getComponent(1),
                                 Display.YAxis);
    ysm.setRange( -100.0, 300.0 );
    display.addMap(xsm);
    display.addMap(ysm);

    // map image brightness values to RGB (default is grey scale)
    display.addMap(new ScalarMap((RealType) image_type.getRange(),
                                 Display.RGB));
    RealType hour_type
      (RealType) image_sequence_type.getDomain().getComponent(0);
    ScalarMap animation_map = new ScalarMap(hour_type, Display.Animation);
    display.addMap(animation_map);
    AnimationControl animation_control
      (AnimationControl) animation_map.getControl();
    animation_control.setStep(step);
    animation_control.setOn(true);

    // create a DataReference for image sequence
    final DataReference image_ref = new DataReferenceImpl("image");
    display.addReference(image_ref);
    //image_ref.setData(image_sequence);

    // link the Display to image_ref
    // display.addReference(image_ref);

    // create JFrame (i.e., a window) for display and slider
    JFrame frame = new JFrame("SimpleAnimate VisAD Application");
    frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {System.exit(0);}
    });

    // create JPanel in JFrame
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
    panel.setAlignmentY(JPanel.TOP_ALIGNMENT);
    panel.setAlignmentX(JPanel.LEFT_ALIGNMENT);
    frame.getContentPane().add(panel);

    // add display to JPanel
    panel.add(display.getComponent());

    // set size of JFrame and make it visible
    frame.setSize(500, 500);
    frame.setVisible(true);

    image_ref.setData(image_sequence);

  }
}