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

Re: Aspect of 2D-Displays

Hi Timo,

If you are looking for a one-to-one correspondence between data samples
and onscreen pixels, that is a bit tricky.  However, fitting the data
aspect to the shape of the display window is not as hard.

You are not the first person to request such a feature in VisAD, so I
added a method setAutoAspect(boolean auto) to DisplayImplJ2D.  If you
call setAutoAspect(true) on a DisplayImplJ2D object, the aspect will
automatically adjust to fit the window every time the display panel
changes size.

The updated classes should be available on the FTP server within a few
days.  In the meantime, you can find the two relevant files at
   http://palm.ssec.wisc.edu/DisplayImplJ2D.java
   http://palm.ssec.wisc.edu/VisADCanvasJ2D.java
Just put these two files in visad/java2d and recompile.

Curtis

At 06:42 11/14/00, you wrote:
>Hi,
>
>I have (IMO) a very simple problem with the axis scaling in 2D-Displays.
>Unfortunatly the manual couldn't help me much with it. The problem:
>
>How to set the aspect of an DisplayImpl2JD such that it covers an
>rectangular area on the screen without strechting all pixels (which it
>does if use ProjectionControl.setAspect())? At the moment the plot is
>always a square even if I change the window size to a rectangle (the
>Display automatically adjusts itself to the minimum of the width and
>height). The perfect behaviour would be an automatic fitting to the
>window size by covering the full available area. 
>Anybody out there who knows about that?
>
>Regards,
>Timo
>-- 
>__.__________
> |lmo |homas


 
 
  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