RE: setting constant map properties

Hi Jim,

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

In order to maintain the rendering order of your Data objects,
any time you change any of them, remove them all and add them
all back. If you bracket all the removes and adds between
display.disableAction() . . . display.enableAction() you can
minimize the time to do this.

Good luck,
Bill


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