Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

AW: Applying shapes in animation

Hi Jay,

> I keep getting java.lang.NullPointerException for the following code:
>
>  ScalarMap shape_map = new ScalarMap(x,Display.Shape);
>  VisADGeometryArray[] shapes;
>  shapes = new VisADGeometryArray[max_points];
>  for(int i=0;i<max_points;i++)
>      {
>   shapes[i] = makeCube();
>      }
>  ShapeControl shape_control = (ShapeControl) shape_map.getControl();
>  shape_control.setShapeSet(new Integer1DSet(1)); // ERROR on this line
>  shape_control.setShapes(shapes);

Add your shape_map to a display before calling the getControl() and the
NullPointerException should be gone.

Cheers, Mathias


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690