Re: change color (UnionSet)

Ben,

See Section 2.4 of Ugo's tutorial. I recommend that you
take the time to work through the tutorial.

Bill

On Wed, 12 Feb 2003, Ben Podoll wrote:

> 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
>
>
>


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