NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: How to link the change to RangeWidget with SelectRangeWidget?

  • To: Bill Hibbard <billh@xxxxxxxxxxxxx>
  • Subject: Re: How to link the change to RangeWidget with SelectRangeWidget?
  • From: Helen Yi <y.yi@xxxxxxxxxxxxx>
  • Date: Thu, 05 Sep 2002 10:10:11 -0400
Thanks Bill,

Is there any way to detect there is a ScalarMap event generated from the
Rangewidget of visMap?

If there is, can I first
double [] xxx = visMap.getRange();

and then do
visRangeMap.setRange((float)xxx[0], (float)xxx[1]);


Thanks, /helen

Bill Hibbard wrote:

> Hi Helen,
>
> > Suppose
> >
> > RealType vis = RealType.getRealType("VIS");
> > ScalarMap visMap = new ScalarMap(vis, Display.RGB);
> > visMap.setRange(-10.0f,10.0f);
> >
> > ScalarMap visRangeMap = new ScalarMap(vis, Display.SelectRange);
> > visRangeMap.setRange(-10.0f,10.0f);
> > .....
> >
> > JFrame f = new JFrame();
> >
> > f.getContentPane().add (new RangeWidget(visMap),BorderLayout.NORTH);
> > f.getContentPane().add (new ColorMapWidget(visMap),BorderLayout.CENTER);
> >
> > f.getContentPane().add (new
> > SelectRangeWidget(visRangeMap),BorderLayout.SOUTH);
> >
> > If I make some change in RangeWidget, i.e. change -10.0f to -5.0f, how
> > this change be reflected in SelectRangeWidget, that is, the select range
> > slider will be moved only between -5.0 to 10.0
>
> Since your SelectRangeWidget is created from visRangeMap but your
> RangeWidget is created from visMap, the RangeWidget will have no
> effect on the SelectRangeWidget. And since the DisplayRealType
> Display.SelectRange is not "scalable", you cannot create a
> RangeWidget from visRangeMap.
>
> Cheers,
> Bill


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