RE: setting constant map properties

Don, Bill

Thank you both for your help.  I now have widget control over line properties 
nearly functional.  I am creating an instance of LineDrawing (derived from 
DisplayableData) for each line that is added to the plot and then store that 
instance in a Vector for later use.  However, I am having a small problem.  
Consider this scenario:

1) Add a line to the plot.  Let's call this Data #1.
2) Add another line to the plot.  Let's call this Data #2.  Data #1 is rendered 
above Data #2.
3) Increase the width of Data #2 (via a SpinButton).  Each increase calls 
LineDrawing.setLineWidth() for Data #2 from my listener.  Data #2 remains being 
rendered beneath Data #1.
4) Increase the width of Data #1 (via a SpinButton).  Each increase calls 
LineDrawing.setLineWidth() for Data #1 from my listener.  Data #2 is now 
rendered above Data #1!

I am not a big fan of this behavior because it can drastically change the look 
of the plot.  Data #1 should always be on top, followed by Data #2, Data #3, 
etc.  It appears to be a result of removing a reference and then re-adding it.  
Is there any way around this?  Perhaps I don't quite understand the listeners 
in DisplayableData.

Any help would, again, be greatly appreciated!

-Jim C.

> -----Original Message-----
> From: Don Murray [mailto:dmurray@xxxxxxxxxxxxxxxx]
> Sent: Saturday, December 13, 2003 10:26 AM
> To: Bill Hibbard
> Cc: Jim Cookas; visad@xxxxxxxxxxxxxxxx
> Subject: Re: setting constant map properties
> 
> 
> Bill/Jim-
> 
> Bill Hibbard wrote:
> 
> > It will probably be easiest if you save your DataReferences
> > in your own arrays or Vectors. You can remove them from the
> > DisplayImpl by a call to removeReference(), then add again
> > with the new ConstantMap values.
> 
> In our IDV, we have a wrapper class for a DataReference
> (DisplayableData) that allows us to control this.  Each
> DisplayableData object can listen for changes to it's
> associated ConstantMaps and then the knows how to tell
> the display to remove the DataReference and re-add it with
> the new ConstantMaps.
> 
> You could consider something like this, or as Bill says,
> keep your own tabs on the DataRefs in a List.
> 
> > Some of the other folks on the list have written complex
> > applications that may do something like this - perhaps they
> > can add to this?
> 
> There is one big performance hit in this. Changing ConstantMaps
> on a DataReference causes the entire display to be rebuilt.
> But, it's still the way to do it.
> 
> Don
> *************************************************************
> Don Murray                               UCAR Unidata Program
> dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
> (303) 497-8628                              Boulder, CO 80307
> http://www.unidata.ucar.edu/staff/donm
> "There's someone in my head, but it's not me"    Roger Waters
> *************************************************************
> 
> 
> 


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