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
Just put these two files in visad/java2d and recompile.


At 06:42 11/14/00, you wrote:
>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?
> |lmo |homas

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