Re: semantics of DataReferenceImpl.setData(null) ??

Hi Stuart-

Stuart Maclean wrote:
I have an web based visad app which is to render as lines, vertices and labels some 'Route' data structure posted by a browser based system. Each 'waypoint' in a route has a lat,lon,name and pointer to 'next
 waypoint.  Lines are to be drawn from a waypoint to its next point.

I have 3 DataReferenceImpls objects attached to a display (J2D). I re-use the display and dataRefs across multiple http calls.

If the Route to be rendered contains a single point, there will be no 'lines' (think from the visad examples). In this case, i use

dataRefForLines.setData( null );

Somewhere in the depths of my mind, I seem to remember that
using null for setData is bad.  In the IDV, we don't add a
DataReference to the display if the data is null.

This call appears to play havoc with the overall rendering of the image.
The image includes the initial vertex and label of previously composed Route objects, i.e. it appears that the call affects the other two DataRefs, one which plots vertices (mathtype is index -> LatLonTuple) and one which draws labels (mathtype is LatLonTuple -> TextType.Generic)

Do you have Cells listening for changes to the dataRefForLines?
When you say "play havoc" what exactly are you seeing?

If I replace the above call with

dataRefForLines.setData( new Real(0) );

all is well.

We do this in the IDV since setting null was considered bad.
However, we were about to look at that again, so maybe you
are prompting that investigation.

I have no idea what is going on. I can post the code if necessary, it may be easier than trying to explain in the abstract. (I did try the display.reAutoScale as per the mail list archives but no change)

I think posting the code would help.   You can send it to me
offline if you want and I'll take a look when I get a chance
(or post to the group and maybe someone else will chime in).

Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307

To unsubscribe visad, visit:

  • 2006 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: