Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Re: How to get the display properties

> Paul Ramsey wrote:
> >I think you have missed my point. Please tell me how, in Java, you are
> >programmatially going to figure out that your display is (a) 1024 pixels
> wide and (b) 304mm wide.

Jody wrote:
> You can access the device information associated with an Image or Page.
> Often you get to know the DPI and the size of the display device. It is
> a bit more complicated for a page, where margins are also provided.

That's the theory. But I doubt this is suitable, e.g. for MS Windows:

In KDE SAX2 is used to set the resolution(e.g. 1024x768), and you can also enter
the display size there. So the DPI resolution is somwhow known to the windowing
manager. AFAIK Gimp reads them out and uses them, for example.
But: What percentage of people actually correctly sets its display size in SAX2?

I'v no idea how this is handled in Gnome.

In Windows this can be found in the Windows control panel.
Right-click on desktop and select "properties". The display properties window
opens. Choose the rightmost tab "settings" and  then "advanced". On the dialog
popping up choose the tab "General". There's the DPI dropdown. It's usually set
to 96 dpi by default, which is equally usually wrong.
You could adjust the dpi resolution to user defined (e.g. 85.5 in my case), but
I warn you: This will make LOTS OF badly designed programmes in Windows look
ugly. So better not do it.

So the problem is:
Even if you could query the display DPI value from Java (which I have simply
never tried yet) and even if Java can query it from Windows or the window
manager - it would in most cases simply be wrong!

>From my experience it would be the best (and only useful?) solution to query the
display size from the user directly on a preferences page in uDig and to check
that these values are non-null.
(For instance, on the very first start of uDig, after the welcome screen, a
Wizard could guide the user through the setting of all required preferences.)

Matthias Basler
c9bama@xxxxxxxxxxx

----------------------------------------------------------------
This mail was sent through http://webmail.uni-jena.de


Back to the top