Re: LabeledColorWidget

Hi John,

> I have created a number of objects (in the form of gridded3dset) and each 
> object is suppose to be slightly transparent with a single color.
> However, i would like the user to be able to manipulate each object's color 
> when they are displayed.  In order to take advantage of
> LabeledColorWidget i have done the following with each object:
> RGBMap = new ScalarMap(m, Display.RGB);
> display.addMap(RGBMap);
> labelCW = new LabeledColorWidget(RGBMap);
> I simply assigned a constant value (say 0.5) to RealType m.  This saves me a 
> lot of work of defining colors, but the user may be confused when
> he/she moves the arrow at the bottom of the Widget and nothing happens 
> (he/she would have to move the red, green and blue curves).  I am
> wondering if there is a better way for me to provide a wide range of color 
> selection...i can't seem to find another simple solution such as
> another Widget.
> Also, is there a similar Widget for controlling transparency (alpha)?  Thanks 
> in advance!

If your ScalarMap is to RGBA rather than RGB, then the
LabeledColorWidget you construct using the ScalarMap will
include editting of an alpha curve. If you want constant
colors from your color table, you can set them directly
via the setTable() method of the ColorAlphaControl and
not even construct the LabeledColorWidget. So the user
wouldn't see any widget at all.

Unidata have a very different widget for controlling color
tables in their Metapps package. This package is freely
available (see the link from the VisAD web page).

Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738

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