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

change color (UnionSet)

I am having trouble changing the color of a UnionSet I am displaying. I
get the UnionSet by opening a shapefile using ShapefileAdapter.

I can change the background of the display as seen below in my code and
the change to foreground only applies to the values displayed in the
upper left corner when a middle mouse event occurs.

I know how to change the axis color via a call to
lonMap.getAxisScale().setColor(Color.BLUE);
But I cannot figure out how to change my UnionSet color.

I see I can't do something like this:
Display.addMap(new ScalarMap( myUnionSet,  Display.RGB ));
since no contructors take Sets.

...
ShapefileAdapter shp = ...
UnionSet myUnionSet = shp.getData();
DisplayImplJ3D display = new DisplayImplJ3D("display");
display.getDisplayRenderer().setBackgroundColor(Color.DARK_GRAY);
display.getDisplayRenderer().setForegroundColor(Color.ORANGE);
display.getGraphicsModeControl().setScaleEnable(true);
display.addMap(latMap);
display.addMap(lonMap);        
DataReference shp_ref = new DataReferenceImpl("shp_ref");
shp_ref.setData(myUnionSet);
display.addReference(shp_ref); 
...

~Ben



 
 
  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