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.
Jim- Jim Cookas wrote:
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!
Just to clarify a little on Bill's response. The "layering" of the data depends on the order in which the DataReferences are added. When you change the ConstantMaps, the DataReference is removed and re-added. This changes the ordering (not sure quite how, since I would think that Data 2 would still be second in line). As Bill says, the only way around this is to keep the ordering of the displays the same and remove all references and add them all back in in the same order. I'll poke around in DisplayMaster when I get a chance to see how the ordering is changing. I won't get to it until later in the week at the earliest. If you have the time, you could add some print statements to the rebuildDisplay method to see what ordering is happening to the DataReferences. (just to clarify for others on the list, DisplayableData and DisplayMaster are part of the ucar.visad.display package in the Integrated Data Viewer and are not part of core VisAD). 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 *************************************************************
visad
archives: