Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: Color Bar

Hi Kevin-

Kevin Manross wrote:

Hi All,

I have a quick question regarding placing a static colorbar in the VisAD Display. A great example of this is in the example provided by Geoff Freeman in the email archives:

http://www.unidata.ucar.edu/support/help/MailArchives/visad-list/msg05554.html

(go here to directly see the example.  Caution, large file)
http://www.bom.gov.au/general/development/visad/MapDemo.shtml

Once you start the demo, you see he has a colorbar that has a constant position within the display. I would like to add this functionality to my display. Is this something that can be set in the VisAD Display, or is it a more general Java behavior.

You can use a visad.bom.ScreenLockedRendererJ3D to add a display
that is screen locked.  See the main method for examples.

We use this in the IDV to add in a color bar.  I took some code
that the BoM had for drawing the color bar.  The hardest part
has been positioning the bar when you are zoomed in or rotated
because the inverse transforms did not give me the expected results.

If you download the IDV source code, you can take a look at:

ucar.visad.display.ColorBar.java     - code for drawing color bars
ucar.visad.Util.java                 - method getVWorldCoords to get
                                       screen coords

also

ucar.unidata.idv.ViewManager         - methods to position the display
                                       label which also uses the
                                       ScreenLockedRenderer.

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


==============================================================================
To unsubscribe visad, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690