Re: BarbRendererJ3D

Tennessee-


Until the ScalarMap is added to the display, the control
is null.  So do a display.addMap(flow1XMap) before
getting the control and it should work.

Don

Tennessee James Leeuwenburg wrote:

My bad ... the NullPointerException is at this line :


  floop.setFlowScale(0.1f); <<<<<<<<<<<<<


of

ScalarMap flow1XMap = new ScalarMap(uType, Display.Flow1X);
flow1XMap.setRange(-40.0, 40.0);
FlowControl floop = (FlowControl)flow1XMap.getControl();
floop.setFlowScale(0.1f);

The rest of the stack trace is just Swing stuff...

I know there's good data in there, because if I don't make that call,
then the data renders correctly (although small), so I can't work out
why the returned flowcontrol might be null...

Let me know anything else you need.

Cheers,
-T



On Tue, 2003-12-02 at 21:19, Bill Hibbard wrote:

Hi Tennessee,


I'm having some hassles with BarbRendererJ3D. Essentially, the barbs are
too small. calling setRange against the flow1X and flow1Y scalarmaps
helped a little, but not nearly enough. I then tried to use the
setFlowScale of FlowControl in order to increase the size of the barbs.
However, what I get is a NullPointerException, caused by the call to
setFlowScale, occurring somewhere in VisAD.


           ScalarMap flow1XMap = new ScalarMap(uType, Display.Flow1X);
           flow1XMap.setRange(-40.0, 40.0);
           //((FlowControl)flow1XMap.getControl()).setFlowScale(0.1f);
           FlowControl floop = (FlowControl)flow1XMap.getControl();
           floop.setFlowScale(0.1f);

Is a FlowControl the right way to enlarge the wind barbs?

That's the right way. Can you send us a stack dump with
line numbers for the NullPointerException?

Cheers,
Bill
p.s., send to visad-list@xxxxxxxxxxxxxxxx



--
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
"There's someone in my head, but it's not me"    Roger Waters
*************************************************************



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